On Mon, 14 Jul 2003, ssrat@mailbag.com wrote:
My current thinking is to do this with one or two hidden files - an
inversion of the one-off process listed earlier:
classes:
DoUpdate = ( FileExists(/var/cfengine/.update) )
AlwaysUpdate = ( FileExists(/var/cfengine/.update-always) )
shellcommands:
DoUpdate::
"apt-get -q -y update" define=updatedone
AlwaysUpdate::
"apt-get -q -y update"
updatedone::
"rm -f /var/cfengine/.update"
Why not use files to mark the *end* of the update, and tell cfengine
to run DoUpdate actions by defining the DoUpdate class externally?
Then you can just check the date of the .updatedone file in the
example below to find the date of the last completion. With your
method, the absence of the .update file doesn't tell you when the
update completed.
classes:
AlwaysUpdate = ( FileExists(/var/cfengine/.update-always) )
shellcommands:
DoUpdate||AlwaysUpdate::
"apt-get -q -y update" define=updatedone
updatedone::
"touch /var/cfengine/.updatedone"