A
A
Alexander2018-02-12 17:23:36
linux
Alexander, 2018-02-12 17:23:36

Cron task not running?

It is necessary that every 10 minutes the script is launched, I registered such a task

*/10 * * * * /usr/bin/python3 /root/membot/vkbot.py > /dev/null 2>&1

Pasted into terminal
/usr/bin/python3 /root/membot/vkbot.py > /dev/null 2>&1

everything worked but log syslog
is not started via cron
Feb 12 17:20:01 debian CRON[16590]: (root) CMD (/usr/bin/python3 /root/membot/vkbot.py > /dev/null 2>&1)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
enabl3, 2018-02-12
@Alex1237

try like this:

*/10 * * * * cd /root/membot/ && python3 vkbot.py > /dev/null 2>&1

A
Alexander, 2018-02-12
@alexr64

Above tasks

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

A
Alexander Mikhailov, 2019-08-21
@sasa_mi

And the problem may be simple, the line feed must be in the crontab file after the task.
Just a newline, you know?
Today I ran into an old children's problem again, I thought for a long time :) let it stay here, next time I forget it again, I'll find it here :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question