Laran Evans
I develop software people love to use.
  • Home
  • About
  • Contact
  • Resume
  • Testimonials
Skip to content
  • Entrepreneurship
    • Leadership
    • Project Management
    • Team Development
    • Time Management
  • Motorcycles
    • Restoration Projects
  • Puzzles
  • Software Architecture
    • Cloud Computing
  • Software Development
    • Algorithms
    • CSS
    • Java
    • Javascript
    • MySQL
    • PHP
    • Python
    • Ruby and Rails
    • System Administration
« Change Any MySQL User Password
Get Past “Tomcat failed to start: Address already in use” Errors »

Debugging Cron on Ubuntu

By laran | Published: 2009/12/10

Basics

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

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.

sudo apt-get install mutt; mutt

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

This entry was posted in System Administration and tagged cron, debugging, ubuntu. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« Change Any MySQL User Password
Get Past “Tomcat failed to start: Address already in use” Errors »

Post a Comment

Click here to cancel reply.

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>

  • About Me

    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 »

  • Subscribe

  • Table of Contents
    • Basics
    • Debugging
    • Wrap Up
  • Similar Posts
    • Installing Magento on Dreamhost the easy way
    • What's running on port XXXX?
    • Get Past "Tomcat failed to start: Address already in use" Errors
    • 6 Must-Know Sys-Admin How-Tos for Web Developers
    • Simple Fix for Apache on Snow Leopard
  • From Around the Web

      Shared Items
    • Recent Posts

      • The carbs are clean!
      • 80 pages of Ruby on Rails Performance Optimization Tips
      • Ruby Garbage Collection In-Depth
      • Binary Logic Basics
      • Kuali in Nacubo Magazine
    • Older Posts By Month

      Let's Talk

      Ask a question below. You'll be prompted for your name and email after you click the "Ask" button.

    Know more. Accomplish more. Succeed.