[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, 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"
Ted
- Re: Strategy for "one-off" tasks, (continued)
- RE: Strategy for "one-off" tasks, Ferguson, Steve, 2003/07/11
- Re: Strategy for "one-off" tasks, David Masterson, 2003/07/11
- RE: Strategy for "one-off" tasks, Ferguson, Steve, 2003/07/11
- RE: Strategy for "one-off" tasks, Ferguson, Steve, 2003/07/14
- RE: Strategy for "one-off" tasks, Nielsen, Steve, 2003/07/14
RE: Strategy for "one-off" tasks, Wheeler, John, 2003/07/15