[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strategy for "one-off" tasks

From: Ted Zlatanov
Subject: Re: Strategy for "one-off" tasks
Date: Tue, 15 Jul 2003 10:17:04 -0400
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (usg-unix-v)

On Mon, 14 Jul 2003, address@hidden 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.


   AlwaysUpdate = ( FileExists(/var/cfengine/.update-always) )


     "apt-get -q -y update" define=updatedone

     "touch /var/cfengine/.updatedone"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]