Using Cron scheduler
Cron is a daemon that executes scheduled commands and is started automatically from /etc/init.d when multiuser run levels are started.
To list all cron jobs
crontab -l
To start a new crontab
crontab -e
Some systems will give you a choice of editor to edit the crontab file, if you want to set yours to a specific editor permanently type
export EDITOR=vi
And to set it for nano
export EDITOR=nano
Use the same process for your favorite editor
Once the file is open add a line containing the format below followed by the command you want to run.
Minute Hour Day of month Month Day Command
0-59 0-23 1-31 1-12 0-6
0 20 13 * 6
For example to run a cron job command looking at the amount of disk space that is free(df -h) at 11:30 *(every day of the month) * (every month) 1-5(day of week)
30 11 * * 1-5 df -h
To run every 20 mins from 7 - 5 on mon,wed,fri
0,20,40 7-17 * * 1,3,5 du -sh /var