Random day of month

This commit is contained in:
Bob Mottram 2015-03-10 19:44:36 +00:00
parent 30066e8de8
commit 5a2c9becab
1 changed files with 3 additions and 0 deletions

View File

@ -1084,6 +1084,9 @@ function randomize_cron {
sed -i "s|17 \*\t|$randmin *\t|g" /etc/crontab
# randomize monthly cron job time and day
randmin=$(($RANDOM%60))
randhr=$(($RANDOM%22+1))
randdom=$(($RANDOM%22+1))
sed -i "s|52 6\t|$randmin $randhr\t|g" /etc/crontab
sed -i "s|\t1 \* \*|\t$randdom * *|g" /etc/crontab