Good ol’ fashioned cron can greatly simplify system maintenance.
A note on system logs: in Linux distributions of the IBM Red Hat family, including Fedora and CentOS, system logs end up NOT in
/etc/syslog.conf
but in:
/etc/rsyslog.conf
instead.
Install cron
Install cron using:
yum -y install vixie-cron crontabs
Make sure the daemon will be switched on after reboot:
/sbin/chkconfig crond on
Start the cron daemon:
/sbin/service crond start
Edit cron jobs
To edit crontab, the command
crontab -e
should suffice. If not, you may want to try editing the file directly:
nano /etc/crontab
Set a default editor for crontab
Set a default editor for your cron jobs:
export EDITOR=/usr/bin/nano
Run cron jobs manually
You can try running select cronjobs right away:
run-parts /etc/cron.monthly
Should that fail, set your cron job in question for a couple of minutes from the current date and time and see if you can catch any errors this way.
Verify the resulting output in the logs:
tail /var/log/cron tail /var/log/messages
If not sure about your instance’s time and date, enter:
date
Leave a Reply