mediatribe.net -- Drupal et développement web

Notice: this post was last updated Il y a 1 year 3 weeks so it might be outdated. Please be cautious before implementing any of suggestions herein.

Reply to comment

Setting up Cron with Drupal 6 and cPanel

If you have a drupal site on a cPanel account, you can set up cron in cPanel. Here is how:

(1) Your site is, say, example.com
(2) Log into cPanel (example.com/cpanel)
(3) Go to cron jobs > standard
(4) Enter the following code in your cron:

/usr/bin/lynx -source http://example.com/cron.php

(replace example.com with your actual website)

I normally choose every hour, every day, every weekday, every month, and choose the minute corresponding to the current time. For example, if it is 8:23 a.m., I choose 23. This is because I have lots of sites on my server, and I don't want all crons to be called at the same time.

Power users can bypass the cPanel user interface and modify the cron directly with the following command in shell, substituting your cPanel username for "username":

$ crontab -e -u username

In the ensuing window, type in the following:

12 * * * * /usr/bin/lynx -source http://example.com/cron.php
31
* * * * /usr/bin/lynx -source http://example2.com/cron.php
59
* * * * /usr/bin/lynx -source http://example3.com/cron.php

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3>
  • Lines and paragraphs break automatically.
  • Vous pouvez publier du code en utilisant les balises <code>...</code> (generic) ou bien <?php ... ?> (PHP colorié).

More information about formatting options

Image CAPTCHA
Enter the characters shown in the image.