add crontab-suggest

master
neingeist 10 years ago
parent 5913fc67b4
commit 9273822038

@ -0,0 +1,17 @@
#!/bin/bash
# suggest a random time for a cronjob
set -u
set -e
hour=$((($RANDOM*24)/32768))
minute=$((($RANDOM*60)/32768))
dow="*"
if [ $# -gt 0 ]; then
if [ "$1" == "-w" ]; then
dow=$((($RANDOM*7)/32768))
fi
fi
printf "%02i %02i * * %s\n" "$minute" "$hour" "$dow"
Loading…
Cancel
Save