Cron Job files on CentOS and Fedora

by
Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0Pinterest0StumbleUpon0Digg

CentOS and Fedora Linux use a set of directories in /etc to control when jobs run.

These directories take the following form:

/etc/cron.hourly – jobs that run once per hour

/etc/cron.daily – jobs that run once per day

/etc/cron.weekly – jobs that run one per week

/etc/cron.monthly – jobs that run once per month

The jobs that you start something like

/sbin/yum  -y  update

or

/sbin/reboot

or running a script some where in your machine

/opt/scripts/script1.sh &

or syncrionize with remote host with Rsync commands

The other way is to add these jobs via Crontab commands :

crontab -e Edit your crontab file, or create one if it doesn’t already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)

and add the line like

* * * * * command to be executed
- – - – -
| | | | |
| | | | +—– day of week (0 – 6) (Sunday=0)
| | | +——- month (1 – 12)
| | +——— day of month (1 – 31)
| +———– hour (0 – 23)
+————- min (0 – 59)

example :

00 06 * * * rm /home/pirat9/tmp/*

Thats mean every day at 6 in the morning remove the tmp files in my directory

If you need any other help, please post it on the Forums

{loadposition user9}

Related Articles By Tags:

{loadposition user1}

For questions please refer to our Q/A forum at : http://ask.unixmen.com/

Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0Pinterest0StumbleUpon0Digg