Posted by gusaus on November 7, 2006 at 6:35pm
Is there some trick to getting cron jobs to work with Dreamhost? I've never been able to get things like the aggregator to automatically update.
Thanks,
Gus
Is there some trick to getting cron jobs to work with Dreamhost? I've never been able to get things like the aggregator to automatically update.
Thanks,
Gus
Comments
There is how I do it on
There is how I do it on shared hostings where I am not allowed to automate cron tasks on the server.
I use a website: www.webcron.org where you can setup cron tasks. This websites seems to be only in french, but there should be some similar websites in english...
If you use this one, be careful not giving your main email adress, they'll use it to spam you...
Thanks for that...
hopefully there's another less spammy option?
---------------------------------------
Gus Austin
http://drupalopenlearning.org/
Have you seen this page?
Have you seen this page?
Just revisited that...
I came across that earlier and was unsuccessful. I'll give it another go.
Thanks!
---------------------------------------
Gus Austin
http://drupalopenlearning.org/
Open your SSH client and
crontab -e39 * * * * /usr/bin/wget -O - -q http://www.example.com/cron.php--
Cheap, reliable Drupal hosting: 200GB | 2TB
Save $75| DH75OFF coupon for 1 year ($3.75/mo!)
Save $50| DH02SETUP coupon for monthly ($10/mo!)
--
Cheap, reliable Drupal hosting: 20GB | 1TB
Save $75| DH75OFF coupon for 1 year ($3.75/mo!)
Save $50| DH02SETUP coupon for monthly ($10/mo!)
can't figure it out
I have trouble with the first step :
Where is the "SSH" client in the Dreamhost Control Panel ?
I downloaded PUTTY. A software mentioned in the documentation here.
I run PUTTY, I enter the host name, I click "open", a command-line prompt appears in a console, I get a message asking "Are you sure this is the right computer you're accessing ? you don't have it cached..." I say "yes". I enter next to the prompt... my user name, enter, then my password, enter, a welcome message appears... and the console window closes. End of story. No window of anything is open on my desktop... I use Windows XP.
Can someone help here ?
I did read these two pages with all the comments :
http://drupal.org/node/31548
http://drupal.org/cron
Caroline
Caroline
11 heavens.com
--
I enabled shell access in DreamHost for myself, using the DreamHost wiki.
There was many options as far as "path" for the shell access. I used the default path. I don't even know what I am doing.
I will retry with PUTTY in a few minutes.
Caroline
11 heavens.com
YEAAAAAAAH
Yep that was it. I didn't have "shell access".
Much later, I ran putty and this time, past the welcome message, I wasn't kicked out. I followed the instructions above.
I entered crontab -l at the command prompt after all the steps and my cron job showed up.
Will report back if the cron has run... from the Drupal logs.
Thank you for such exquisite instructions.
It should make it into the documentation.
Caroline
Caroline
11 heavens.com
Whoooooo HOOOOOOOO
Benthere...
Here is what my log tells me (I used the "39" like you) :
cron 2007-01-01 17:39 Cron run completed Anonymous
Bliss....
I love you.
Caroline
Caroline
11 heavens.com
You could set up a schedule in windows xp.
The way i have it set up:
I downloaded wget, installed it in my windows directory, then open the scheduled task, then configure my cron job to run every x hours/minutes.
Tecito.com
Comunidad Latina en Canada, regístrate ya! Join the growing latin community in Canada.
- Hectorplus Web Design
- Jobs in Canada for Latinos
You are a saint
Thank you for your perfectly succinct instructions, they worked beautifully. (I don't mind being treated like an idiot if it gets the job done!)
I just fixed this issue on
I just fixed this issue on my site. I decided to use the cron-lynx script that is provided within Drupal.
I created a cron entry like this:
45 * * * * /home/odb/organizersdb.org/scripts/cron-lynx.sh
I went ahead and tried running it from the command line by typing:
/home/odb/organizersdb.org/scripts/cron-lynx.sh
and I got a permission denied error. Turns out that to get it to run, I had to change the permissions:
chmod 755 cron-lynx.sh
which makes it executable. Then I could run it but still, the run did not show up in the logs of my Drupal site.
Then I opened cron-lynx.sh in a text editor and noticed that it says:
/usr/bin/lynx -source http://yoursite.com/cron.php > /dev/null 2>&1
Well obviously this needs to be customized to have our site in it:
/usr/bin/lynx -source http://organizersdb.org/cron.php > /dev/null 2>&1
THAT did the trick, now the cron run shows up in the Drupal logs when
I run it from the command line.
-rich
Organizers' Collaborative -- Free Software for Activist Groups
http://organizerscollaborative.org and http://organizersdb.org
alternative method for DreamHost cron jobs
I tried the wget method explained above, but for some reason it wasn't working for me. So I contacted DreamHost support and they suggested using php instead of wget in my crontab file.
So, I *was* using (this did not work):
0 * * * * /usr/bin/wget -0 - -q http://my_domain.com/cron.phpBut then switching my crontab to the following worked fine:
0 * * * * /dh/cgi-system/php.cgi /home/my_dreamhost_user/my_domain.com/cron.phpIt depends on what version of PHP your domain is running; the above example is for PHP 4. For PHP 5, you would change "php.cgi" to "php5.cgi". If you don't know your PHP version, check the DreamHost Control Panel (domains > manage domains > edit) or your Drupal admin screens (/admin/logs/status/).
(There's an alternative method that requires you to edit the contents of cron.php itself, but I decided to steer clear of that one.)
More info here: http://dhurl.com/?al9HvqwB
I hope that helps anyone else who gets stuck like I did.
droopy75
Now very easy
Adding cron jobs on Dreamhost is now very easy via their web panel.
In the Goodies -> Cron Jobs section add a new cron job and simply enter the following for the command:
wget -q http://notesonsurvival.info/cron.phpSaving this modifies the user's crontab. If you ssh into your account and run
crontab -lthere will be an entry something like this
@daily /usr/local/bin/setlock -n /tmp/cronlock.728470.6042 sh -c $'wget -q http\072//notesonsurvival.info/cron.php'Works for me!
wget -q --delete-after
hi,
On dreamhost wiki http://wiki.dreamhost.com/Cron
they advice to use:
wget -q --delete-after http://www.MYSITE.com/cron.php
but is it necessary to use --delete-after ?
Thanks!
RE: wget -q --delete-after
I played with this at the command line without the quiet option to learn more. I found that this:
wget -q http://example.com/cron.php
creates an empty file called cron.php at the user root.
If I use:
wget -q --delete-after http://example.com/cron.php
it deletes this file immediately after the job is done.
Considering that it is an empty file and that each iteration will overwrite the same file, I doubt that it does any harm to leave it out. Personally, I like to keep things clean & include this option.
poormanscron is what you need
http://drupal.org/project/poormanscron
I hope this should suffice your need
I ran it on dreamhost and you can configure the cron to run under /admin/settings/site-information
this will run the cron every hour(in my case)
--
(◣_◢) .......rock on...\m/
Bhaskar Tiwari
GTSE Generalist
Directory Services
Microsoft
\____________________________________________________________
All we have to decide is what to do with the time that has been given to us
http://www.ebhakt.com/
http://fytclub.net/
http://ebhakt.info/
you might use this
http://post.fytclub.net/servers/?p=63
Working solution
Add new cron job and put in command field
wget -qO /dev/null http://somesitename.com/cron.php
repalce "somesitename.com" with your domain name