How to run scripts automatically using crontab.
Would you like to…
Print this page
Email this page
Add to favorites
You can use the crontab to automate the running of scripts on your server. Cron is started automatically on entering multi-user run levels. To view your crontab, log in as the root user and run:

This will ping 192.168.0.1 once each minute continuously. The > /dev/null portion redirects standard output to /dev/null so that the root user is only emailed if there is an error running the command. You can change this to > /dev/null 2>&1 to also trash error output.

To edit your crontab, run:
#crontab -e

Note: The text editor you use will be defined by the EDITOR variable. If you want to use a simple text editor, run the following command before editing the crontab: