0

Ubuntu

In my Ubuntu VM, I have configured a cronjob

cat /var/spool/cron/crontabs/*

MAILTO="myemail@gmail.com"
* * * * * python /home/forge/web-app/database/backup_mysql.py

I checked pgrep cron I got number printing out fine.


It been 5 mins now, I don't see any email send to me. I don't see any backup file is being generated.

I have a feeling that this cronjob never got run.

How do I debug this ?

Do I need to restart some kind of service ?

codeforester
  • 39,467
  • 16
  • 112
  • 140
code-8
  • 54,650
  • 106
  • 352
  • 604

1 Answers1

1

Could you please check the cron service.

service cron status.

And check the cronjob logs to check it is running or not

tail -f /var/log/cron | grep username

Check the cron crontab -e -u username

And also check permission.

chmod +x <file>
bibincatchme
  • 333
  • 4
  • 10
  • I saw it triggered now, but for some reasons the email part is not working. – code-8 Mar 06 '17 at 20:14
  • I don't see it trigger any email to my email that I set in there. What can I check to debug this further ? – code-8 Mar 06 '17 at 20:15
  • You may want to take a look at this SO post: http://stackoverflow.com/questions/41755437/managing-log-files-created-by-cron-jobs – codeforester Mar 06 '17 at 20:25