Dealing with Crontab

Schedule tasks under Linux is an powerful procedure which is used by almost everyone, and to do this using program called cron. more about it here .

Procedure :

make a new text file, and enter this line in that text file like the below :-

crontab myfirstjob

Formatting crontab file :-

what this file contains

Number
Meaning
Allowed range
1
Minutes
0-59
2
Hours
0-23
3
Days
1-31
4
Months
1-12 OR First 3 letters of the Month name
5
Days of the week
0-7 OR First 3 letters of the Day name
6
Name of the program
Any program

Some useful command can be used with cron :-

Show all the task running under cron.

crontab -l

edit the crontab

crontab -e

Some example from crontab file :-

# Minute   Hour      Day of Month       Month                 Day of Week        Command  
# (0-59)     (0-23)     (1-31)             (1-12 or Jan-Dec)    (0-6 or Sun-Sat)              
    0               12           *                             *                         *            /u01/backup.sh

For more example about crontab press here

Cheers
Osama Mustafa

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.