I’ve set up cron jobs to start and stop one of my servers, along with backups and archives. I would now like to use this same config file and use it for my other servers.
Can I simply copy the cron.config file from /servers/server1 to /servers/server2 without chaning the GUIDs for each job?
Yes, this is possible. In fact, these values are not GUIDs but instead just hashes of the cron expression, command, and additional arguments.
Thus, they do not need to be “Globally Unique” (GU), but just server unique. This is also why create-server-from-archives and importing works.
That’s great news. Thanks for your reply.
While playing around, I also found that I can use the additional argument field to store a comment, which makes things easier when scheduling multiple jobs. My tasks now look like this:
Expression Command Arguments
0 */5 4-5 * * 1-5 backup Backup every 5 minutes between 12-1pm
Can you verify those backups are still working with that ‘comment’ in there? I was under the impression the unexpected argument would cause a problem.
Bugger…you are correct - the backups did not run. A pity, because that would have been helpful. It’s not super-important though. I will remove my comments from the .config
While we’re on the topic of modifying tasks, is it possible to reload the cron.config? I have had to manually edit the cron.config file, and have resorted to rebooting the server if I make a change.
I have tried node service.js restart and node webui.js restart, but they did not seem to reload the config.
Another nice feature would be to allow edits - sometimes you just want to modify the schedule, or correct the spelling of a server command. I haven’t found any way to do this without manually editing the cron.config.
Aren’t you able to just disable/enable the cron from the webui? This should effectively reload that rule, but at the very most, restarting the webui should 100% reload the crons–it’s just as unloaded when restarted as when the host is rebooted.
In the webui, copy the cron expression to the ‘new’ cron field. Select the same dropdown (e.g., backup). Create/enable the new expression. Delete disable the old expression.
This should work, provided that there are no undesirable ‘comments’ in the rule. (Update the webui which actually enforces this)