better use of RANDOM in cron example

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-07-13 09:33:07 +02:00
parent 905410f93d
commit 3a658ea1ab

View File

@ -7,7 +7,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v0.98-0-g5b5447e
#### $$VERSION$$ v0.99-dev2-9-g905410f
SHELL=/bin/sh
@ -27,9 +27,9 @@ MAILTO=root
# * * * * * USER command to execute
# * * * * * root echo "run every minute!"
# run as www every day at 0:00 plus random sleep between 1-3h
0 0 * * * nobody sleep "${RANDOM:0:4}s" ; /usr/local/telegram-bot-bash/bashbot.sh start # (re)start bot
0 0 * * * nobody sleep "${RANDOM:0:4}s" ; /usr/local/telegram-bot-bash/bashbot.sh resumeback # (re)start background jobs
# run as www every day at 0:00 plus random sleep between 0-3h
0 0 * * * nobody sleep "$((RANDOM \% 180 ))m" ; /usr/local/telegram-bot-bash/bashbot.sh start # (re)start bot
0 0 * * * nobody sleep "$((RANDOM \% 180 ))m" ; /usr/local/telegram-bot-bash/bashbot.sh resumeback # (re)start background jobs
# run as www on 24 of Dec, 12:00
0 12 24 12 * nobody /usr/local/telegram-bot-bash/bashbot.sh broadcast "X-Mas shopping is over!" # broadcast a message