Answer the question
In order to leave comments, you need to log in
cron job not working?
I can't figure out why the script doesn't run in cron. The script itself works. Must run let's say at 14:10 every day. But why doesn't he want to
# m h dom mon dow command
10 14 * * * /root/MyFunnyEnglishBOT/bot.sh
Jul 16 14:38:01 askdem CRON[8850]: (root) CMD (echo "test")
Jul 16 14:47:01 askdem CRON[9019]: (root) CMD (/root/MyFunnyEnglishBOT/bot.sh )
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
#!/bin/sh
killall python3;
./sendmessage.py;
screen -d -m ./Bot.py;
Answer the question
In order to leave comments, you need to log in
And where did you get the idea that echo in the cron should output to YOUR console?
cron runs tasks in the background, and all stdout is usually redirected to a local email to the user on the localhost.
If you want to see the output of what your cron script displays, write like this:
10 14 * * * /root/MyFunnyEnglishBOT/bot.sh>>/root/MyFunnyEnglishBOT/bot.log
And see what appears in this log file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question