schudeling at a specific time

19 views
Skip to first unread message

Toby Archer

unread,
May 6, 2014, 10:46:55 AM5/6/14
to salt-...@googlegroups.com
I see that I can schedule tasks to run at a set interval. But I've not had any luck finding a way to set a task to run at a specific time. I added this into my crontab on my master:
0 20 * * * salt 'theta*' system.shutdown
It works, but feels like hanging a picture with a slege hammer. Is there a way to do something like:
schedule:
  scheduled_task:
    function: system.shutdown
    time: 0 20 * * *

I used the crontab notation here, but that's just a stand in. The important thing is that I want to schedule various computers to shutdown at various times. But I currently only see a way run something after a certain amount of time. while the idea of shutting everyone's computer down at random times through the day is remarkably amusing, the result (everyone in my office complaining) is not so amusing. SO. that would be good.

Further it would be really nifty if it could be set to run over a range of time. for example, the library computers not only should be shutdown at the end of the day, but they should keep themselves off until morning to keep students from staying up all night.

Is there anything that can do these sorts of things?

Gareth J. Greenaway

unread,
May 6, 2014, 11:22:36 AM5/6/14
to salt-...@googlegroups.com
One of the new featured added to the scheduler, which will hopefully make it's way into the Helium release, is the ability to schedule jobs and tasks as a specific time.  A new parameter called when was added and it uses the same syntax that the dateutil python module uses.  This functionality is available in the latest develop branch if you're curious and want to give it a try.  One of the additions to this that I had been kicking around was adding the ability to specify a time/date range of when a job should run.

Gareth
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages