Salt cron with random minutes or hour

29 views
Skip to first unread message

Andrey Pupkin

unread,
Jan 17, 2018, 11:43:46 PM1/17/18
to Salt-users
Hi, i have a quesition,
How can i deploy minutes or else with random time such as '*/random'

Course this got an error 
date > /tmp/date:                                                                                                                                                                                                                         
     cron.present:                                                                                                                                                                                                                         
        - identifier: test                                                                                                                                                                                                                 
        - user: root                                                                                                                                                                                                                       
        - minute: '*/random' 
________________________________________________________________

 ID: date > /tmp/date
    Function: cron.present
      Result: False
     Comment: Cron date > /tmp/date for user root failed to commit with error 
              "/tmp/tmpiNNsjU":12: bad minute
              errors in crontab file, can't install.
     Changes:   

Andrew Melo

unread,
Jan 18, 2018, 12:03:11 AM1/18/18
to salt-...@googlegroups.com
Hi Andrey,

A lot of crons don't have that functionality built in, so I usually
manually add a random sleep at the beginning of the command.

Cheers
Andrew
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/salt-users/44a28b5d-9dc7-44a1-8ce0-84f9f5b4ffe9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
--
Andrew Melo
Reply all
Reply to author
Forward
0 new messages