Little Girl's Mostly Linux Blog

Cron

Cron

This page was last updated on July 18, 2009.

See the Wikipedia Cron page for an indepth explanation of what Cron is and how to use it.

Add a cron job

  1. Open a terminal window and type:
  2. crontab -e

    Crontab creates a temporary file and opens the nano editor.

  3. Type in the cron job:
  4. 30 14 * * * env DISPLAY=:0.0 /usr/bin/kaffeine

    This example will run Kaffeine every day at 2:30 p.m. The env DISPLAY=:0.0 part is only required for GUI applications.

  5. Save the file by pressing the Ctrl and o (that’s the letter – not a zero) keys at the same time.
  6. Type in either a file name or a path and file name and press the Enter key.
  7. Exit the nano editor by pressing the Ctrl and x keys at the same time. Crontab will merge your changes into your crontab.

Look at your cron job(s)

  1. Open a terminal window and type:
  2. crontab -l

Edit your cron job(s)

  1. Open a terminal window and type:
  2. crontab -e
  3. Type in the changes you wish to make to the file.
  4. Save the file by pressing the Ctrl and o keys at the same time.
  5. Type in either a file name or a path and file name and press the Enter key.
  6. Exit the nano editor by pressing the Ctrl and x keys at the same time. Crontab will merge your changes into your crontab.

Remove your cron job(s)

  1. Open a terminal window and type:
  2. crontab -r


Obligatory Happy Ending

And they all lived happily ever after. The end.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Comment:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: