Forum: CFEngine Help
Subject: Re: help with commands - append date to file
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,23912,23916#msg-23916

You should probably use CFE touch => "true" to the file promise, if you'd to 
touch the file.

    files:
        "${testfile}" -> "Some Person",
            comment => "Make sure ${testfile} exists",
            create  => "true",
            touch   => "true";


Anyhow, in order to use UNIX IO redirection, you have to run the command in 
shell. A contain body is an answer.


    commands:
        "/bin/date >> ${testfile}"
            comment    => "Echo current date to our file",
            contain    => in_shell;

...
...

body contain in_shell
{
 useshell => "true";
}


Cheers,
--Nakarin

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to