Skip to: site menu |main content

Welcome to my personal site. If You have any question or suggestion please feel free to contact me from contact page.

Advertisements

Contact me to place your Ads Here..

Powered by Drupal, an open source content management system

Syndicate

Syndicate content
 
 

Adding cron jobs from crontab on Linux for drupal site using lynx and wget and curl commands

No replies
inder's picture
Offline
Joined: 06/23/2009
Adding cron jobs from crontab on Linux for drupal site using lynx and wget and curl commands

Cron executes commands at specified intervals. These commands are called "cron jobs." Cron is available on Unix, Linux and Mac servers. Windows servers use a Scheduled Task to execute commands.

The cron command

To edit a crontab through the command line, type:

crontab -e

In the following example, the crontab command shown below will activate the cron tasks automatically on the hour:

0 * * * * wget -O - -q -t 1 http://www.indersingh.com/cron.php
#
+---------------- 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

E.g To run a cron job for drupal site named as "indiauser.com" you can add one of entry in crontab file:
45 * * * *  /usr/bin/lynx -source http://indiauser.com/cron.php
45
* * * * /usr/bin/wget -O - -q -t 1 http://www.indiauser.com/cron.php
45
* * * * curl --silent --compressed http://indiauser.com/cron.php

This would have a lynx, wget, or curl visit your cron page 45 minutes after every hour.

Three options are provided in case either wget, lynx or curl are not installed on the server. Any will do the job well.

Back to top

Related Pictures

Tags for Adding cron jobs from crontab on Linux for drupal site using lynx and wget and curl commands

Recent comments

InderSingh.com v1.2
(Feb 05, 2012)