Ubuntu: my cronjob in /etc/cron.d is not running

Ubuntu: my cronjob in /etc/cron.d is not running

If your cron job is not running as expected check the following:
– permission for this file should be 600 – one one can read except root
– check the syntax
– you need to provide the user that the job should run with ( this is different with crontab -e where it will use the current user)
– sometimes your file may have some special characters such as ^M, you don’t see them in normal editor , you can run this command : cat -v /etc/cron.d/your_cron_job file
– Make sure that cron service is running:  ps -aux | grep cron
– check the log file : cat /var/log/syslog | grep cron

Leave a Reply

Your email address will not be published. Required fields are marked *