Good evening. Set up a task in /etc/cron.d/upload:

5 4 * * * root python /var/www/webapps/mysite.ru/upload.py > /dev/null 2>&1 5 5 * * * root python /var/www/webapps/mysite.biz/upload.py > /dev/null 2>&1 

Tell me, please, why he doesn’t want to work (there’s an empty line at the end of the file, something like it should have been written somewhere). OS debian, reboot the machine. In the logs:

  May 8 04:54:31 hs-python anacron[526]: Anacron 2.3 started on 2016-05-08 May 8 04:54:31 hs-python anacron[526]: Will run job `cron.daily' in 5 min. May 8 04:54:31 hs-python anacron[526]: Will run job `cron.weekly' in 10 min. May 8 04:54:31 hs-python anacron[526]: Will run job `cron.monthly' in 15 min. May 8 04:54:31 hs-python anacron[526]: Jobs will be executed sequentially May 8 04:59:31 hs-python anacron[526]: Job `cron.daily' started May 8 04:59:38 hs-python anacron[526]: Job `cron.daily' terminated May 8 05:04:31 hs-python anacron[526]: Job `cron.weekly' started May 8 05:04:31 hs-python anacron[526]: Job `cron.weekly' terminated May 8 05:09:31 hs-python anacron[526]: Job `cron.monthly' started May 8 05:09:31 hs-python anacron[526]: Job `cron.monthly' terminated May 8 05:09:31 hs-python anacron[526]: Normal exit (3 jobs run) 
  • 1. Is the cron process running at all? 2. touch /tmp/somefile something test (like touch /tmp/somefile ) running? - aleksandr barakin
  • Write the full path to the python - kmv
  • The test task did not work. Full path prescribed. - Ildus N.
  • repeat question: is the cron process running at all? - aleksandr barakin
  • do not tell me how to check? ) - Ildus N.

1 answer 1

Make sure that the cron process is running, for example, using the ps command.

 ps uax | grep cron 

if it is not in the process, try to start it

 /etc/init.d/cron start 

if it is observed in the processes, try restarting

 /etc/init.d/cron restart