Linux

The cron command

The crontab command shown below will activate the cron tasks automatically on the hour:
0 * * * * wget -O – -q -t 1 http://www.jit.co.in/cron.php

In the above sample, the 0 * * * * represents when the task should happen. The first figure represents minutes – in this case, on the “zero” minute, or top of the hour. (If the number were, say, 10, then the action would take place at 10 minutes past the hour.) The other figures represent, respectively, hour, day, month and day of the week. A * is a wildcard, meaning “every time.”

The rest of the line basically tells the server to “ping” the url http://www.jit.co.in/cron.php.
Here is a diagram of the general crontab syntax, for illustration:

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

Add ONE of the following lines:

45 * * * * /usr/bin/lynx -source http://jit.co.in/cron.php
45 * * * * /usr/bin/wget -O – -q -t 1 http://www.jit.co.in/cron.php
45 * * * * curl –silent –compressed http://jit.co.in/cron.php.

Tagged ,

About Jit

Having expertise in dynamic and interactive web applications design and development looking for a challenging position in LAMP (Linux, Apache, MySQL and PHP) environment and MySQL DBA.In depth Knowledge and experience of client/server technologies, internet/intranet based programming techniques, MVC Architecture server management and object-oriented approaches, user centered design approach.Expertise in Provides Business Solutions, Project Documentations, Architecture, Design, Functional Documentation
View all posts by Jit →

Leave a Reply

Your email address will not be published. Required fields are marked *

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