RSS

yum install cronjob

17 Feb

Cron is a daemon that can be used to schedule the execution of recurring tasks according to a combination of the time, day of the month, month, day of the week, and week.

Install crond/crontab on linux:

# yum install vixie-cron crontabs
# /sbin/chkconfig crond on
# /sbin/service crond start

set default editor for crontab:
# export EDITOR=/usr/bin/nano

Setup crontab:
# crontab -e
1 2 3 4 5 /path/to/command arg1 arg2

Where,

* 1: Minute (0-59)
* 2: Hours (0-23)
* 3: Day (0-31)
* 4: Month (0-12 [12 == December])
* 5: Day of the week(0-7 [7 or 0 == sunday])
* /path/to/command – Script or command name to schedule

* * * * * command to be executed
– – – – –
| | | | |
| | | | —– Day of week (0 – 7) (Sunday=0 or 7)
| | | ——- Month (1 – 12)
| | ——— Day of month (1 – 31)
| ———– Hour (0 – 23)
————- Minute (0 – 59)

Sample:

* * * * * env php -q /var/www/html/cron.php

How to run cronjobs per second?

🙂

Advertisements
 

Tags: , , , , ,

2 responses to “yum install cronjob

  1. Noorsingh

    August 26, 2010 at 5:40 pm

    Hello Sandeep,

    You have mentioned in your Blog as “THINK LIKE A COMPUTER” and as per my knowledge and to correct you I think that computers are not human, therefore they cannot think. !!!

    Bye

     
  2. sandeepverma

    August 27, 2010 at 3:17 am

    Yes, You are right!
    But my opinion is different… currently we work for Clients and they operate us.
    Means we have to think like computers to follow Master’s Instructions to get paid.

    Our Development life is so typical…

    Thanks

     

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: