Forum: Cfengine Help
Subject: Re: command execution example
Author: ro
Link to topic: https://cfengine.com/forum/read.php?3,20157,20171#msg-20171

Hi Daniel,
this is the snippet that I'm using on Ubuntu 10.04:


bundle agent AptUpdate {
commands:
        UPDATE::
                "/usr/bin/apt-get update > /dev/null 2>&1"
                        contain         => setuid_sh("root"),
                        action          => one_day_delay,
                        comment         => "Update the package list";
                "/usr/bin/apt-get -y dist-upgrade > /dev/null 2>&1"
                        contain         => setuid_sh("root"),
                        action          => one_day_delay,
                        comment         => "Install all updates including 
kernel updates";
}


The one_day_delay body looks like this:

body action one_day_delay {
        ifelapsed       => "1420";
}

Hope that helps!

Cheers,
Robert


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

Reply via email to