Create a crontab by defining it in a text file and then hand it over to cron with this command:
crontab my_text_file.txt
List your cron jobs with
crontab -l
Edit your cron jobs with
crontab -e
Remove all your cron jobs with
crontab -r
If you’ve scheduled a cron job but it doesn’t seem to be running, here are a few things to remember.
% characters in your crontab need to be escaped
Your crontab needs to have a newline at the end.
All cron events are logged to /var/log/syslog.
Check there for information.
By default, the output of each cron run is emailed to the user that it runs as.
This is your unix mail. So, check your unix login account mail for messages. These will be very helpful.
I use mutt to read unix mail.
sudo apt-get install mutt; mutt
That should be enough to allow you to figure out what’s preventing cron from behaving as you think it should.
For more information you can take a look at the official CronHowTo page on the Ubuntu Community Wiki
Your email is never published nor shared. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
I've got a masters degree in computer science and over 10 years of experience building web-based systems using Java/J2EE, Ruby, Rails and PHP. I'm a strong believer in the effectiveness of Agile Methods. Read more »
Debugging Cron on Ubuntu
Basics
Create a crontab by defining it in a text file and then hand it over to cron with this command:
List your cron jobs with
Edit your cron jobs with
Remove all your cron jobs with
Debugging
If you’ve scheduled a cron job but it doesn’t seem to be running, here are a few things to remember.
% characters in your crontab need to be escaped
Your crontab needs to have a newline at the end.
All cron events are logged to /var/log/syslog.
Check there for information.
By default, the output of each cron run is emailed to the user that it runs as.
This is your unix mail. So, check your unix login account mail for messages. These will be very helpful.
I use mutt to read unix mail.
Wrap Up
That should be enough to allow you to figure out what’s preventing cron from behaving as you think it should.
For more information you can take a look at the official CronHowTo page on the Ubuntu Community Wiki