Cron
Cron service can be used for scheduled cron jobs runs. Daemon can be managed via the /etc/init.d/crond interface, and cron tables managed via crontab. Crontab supports:
Usage:
crontab [options] file
crontab [options]
crontab -n [hostname]
Options:
-u <user> define user
-e edit user's crontab
-l list user's crontab
-r delete user's crontab
-i prompt before deleting
-n <host> set host in cluster to run users' crontabs
-c get host in cluster to run users' crontabs
-x <mask> enable debugging
To perform start/stop/restart on crond service:
/etc/init.d/crond start
Cron doesn't need to be restarted when crontab file is modified, it examines the modification time on all crontabs and reload those which have changed.
To verify the current crond status:
/etc/init.d/crond status
To check current cron jobs running with the following command to list all crontabs:
crontab -l
To edit or create a custom crontab file:
crontab -e
This opens a personal cron configuration file. Each line can be defined as one command to run. The following format is used:
minute hour day-of-month month day-of-week command
For example, append the following entry to run a script every day at 3 am:
0 3 * * * /etc/config/backup.sh
Save and close the file.