Running Cron Job on Ubuntu - Quick Reference and Simple Examples

Last updated:

WIP Alert This is a work in progress. Current information is correct but more content will probably be added in the future.

cron is the default way to schedule jobs (shell scripts and/or commands) and make them run repeatedly in a defined manner on any Unix-based OS.

Here are some quick examples on how to use it:

set up a command or small snippet to run repeatedly

After you finish editing, make sure you close the file or changes won't take effect. (For example, if on vim, don't just use :w to save, use :wq to save and close the file).

$ crontab -e

And, if you need to run some command as root, use this instead:

$ sudo crontab -e

W.I.P.: This is a work in progress.

Dialogue & Discussion