Forum: Cfengine Help
Subject: "Hourly" splayclass for daily staggered script execution; some nodes
not executing
Author: dfriedman
Link to topic: https://cfengine.com/forum/read.php?3,18359,18359#msg-18359
I'd hoped to use a splayclass result to splay a daily script execution for 5
servers over the course of a particular hour (3-4pm) each day. Here's how I
coded it:
classes:
"splay_result" expression => splayclass("$(sys.host)$(sys.ipv4)","hourly");
commands:
Hr15.splay_result::
"/path/to/dailyscript.sh";
3 days later, I'm finding that 2 of the 5 servers aren't running the script (no
error output either; I watch carefully between 3 and 4pm and as far as I can
see those 2 servers are never even trying execute it). I assume this is due to
the splayclass never being true during a cf-agent run between 3 and 4pm. The
manual warns of this possibility if you change the execution schedule from the
default (every 5 mins), but I haven't changed it. I'd rather not have to
hardcode the hostnames into classes and times, as this means I have to remember
to change this promise if I add servers to the mix.
Is there a way to guarantee this will execute at some point during the hour?
Would recoding it with a wider window (say, 2:50pm to 4:10pm or something) help?
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine