mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-25 08:47:34 +00:00
74294f3fb4
change bashbot.sh to bashbot.rc
38 lines
1.6 KiB
Plaintext
38 lines
1.6 KiB
Plaintext
#
|
|
# this is an example crontab file for telegram-bot-bash
|
|
# copy it to /etc/cron.d/bashbot
|
|
#
|
|
# (c) https://github.com/gnadelwartz
|
|
#
|
|
# This file is public domain in the USA and all free countries.
|
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
|
#
|
|
#### $$VERSION$$ v1.52-1-g0dae2db
|
|
|
|
|
|
SHELL=/bin/sh
|
|
PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:
|
|
# place your mailadress here
|
|
MAILTO=root
|
|
|
|
|
|
# ┌───────────── minute (0 - 59)
|
|
# │ ┌───────────── hour (0 - 23)
|
|
# │ │ ┌───────────── day of the month (1 - 31)
|
|
# │ │ │ ┌───────────── month (1 - 12)
|
|
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
|
|
# │ │ │ │ │ 7 is also Sunday on some systems)
|
|
# │ │ │ │ │
|
|
# │ │ │ │ │ ┌───────────── run as user (must be omited in users crontab
|
|
# │ │ │ │ │ |
|
|
# * * * * * USER command to execute
|
|
# * * * * * root echo "run every minute!"
|
|
|
|
# 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.rc start # (re)start bot
|
|
0 0 * * * nobody sleep "$((RANDOM \% 180 ))m" ; /usr/local/telegram-bot-bash/bashbot.rc 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
|
|
|