By newbie8-1 on
Hello again.
My site has rss news feeds that do not "update" automatically. I learned that the cron jobs need to be configured for it to automatically update.
I installed Drupal using cpanel/fantastico. I have seen a cron jobs area at cpanel and there is a blank slot to enter something to run.
What should I enter in that cpanel/cron jobs blank area?
Please note that I am a newbie and would not understand Drupal or php linggo.
I have researched on the topic but none of the answers seems to fit with the cpanel cron jobs topic.
Thank you.
Comments
Does HOWTO: Install Drupal
Does HOWTO: Install Drupal using cPanel subheading Cron tasks contain the relevant information?
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Thank you for your prompt
Thank you for your prompt reply.
Based on the topic/link you suggested, it still does not answer it clearly for a newbie like me.
I am currently inside the cron jobs area inside cpanel and there is a space which says "command to run" and below that are some parameters relating to "time" and below that are buttons: "save crontab" and "reset changes".
What should I input inside the "command to run" area?
Is it ...www.example.com/cron.php ?
The instructions provided are not clear for newbies.
Thanks again.
Here you go
wget -O /dev/null http://www.yoursitename.com/cron.php 2>/dev/nullAttention for CPanel users
I know this thread very old, but I want to answer using CPanel method, rather than general *nix.
If u use CPanel the command is: /home/your_cpanel_account/public_html/cron.php
So, if your website is: www.drupal-id.com then CPanel will automatically named your CPanel account as: drupalid, thus your command is:
Example: running daily cron at 5 am is:
From the page
From the page:
To run cron.php every day set the Minute and Hour fields to
0and the rest of the fields to*. The command to run is:(note, the only cpanel server I had access to required GET)
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Thank you both for your
Thank you both for your inputs. I have noticed that there are slight differences with both commands. Will they have the same results?
This is something to add to the "manual" if it works. Will try it out and will let you guys know if it works.
How can I tell if it will work?
It works! I checked the
It works! I checked the aggregator area and it shows that the news feeds have been refreshed. Thank you once again for the help and support in this wonderful community.
Thanks also
I too spent quite a bit of time on this issue.
For two years I have had to suffer the indignancies of CPanel's ridiculous docs.
It wouldn't be so bad if they at least made it possible to submit corrections to their documents. I'd do it for free, if they wouldn't make it so full of rings to jump through just to log in.
Again, thanks to all of you who helped!!!
this worked with wget
this worked for me using Cpanel on byethost.org but I changed it to wget instead based on this comment since the server is running Linux.
This worked for me as well!
This worked for me as well! using ANHosting and Cpanel.
difference between wget and lynx
i am working with the scheduler module, and wanted to report some weird results.
with cron as follows:
/usr/bin/lynx -source http://www.netsquared.org/cron.php (every 15 minutes)
1) i create a post to publish at 2:29.
2) i wait for 2:30, and then 2:45 - nothing
3) i check in the status report to see if cron is running and is SAYS it is.
4) when i run cron manually at this point (2:53), the post publishes.
with cron set up as follows:
/usr/bin/wget -O - -q -t 1 http://www.netsquared.org/cron.php
1) i create a post to publish at 2:29.
2) i wait for 2:30, and the post publishes.
why the difference? i just want to understand in general - outside of making this work. why would status report say cron had run when in actuality it did not?
--
anawillem
http://jellobrain.com
Just FYI for others:
Just FYI for others: "/dev/null" is used to suppress the output and email notices you would otherwise receive
cron
Great and thank you! that helped me
Hv foll positive notice to email
Gamepart, Krambol
URL to your cron.php inside
URL to your cron.php inside your drupal installation
http://domain.com/cron.php
http://domain.com/mydrupal/cron.php
*Download and use poormanscron.module
Oops it is not working. I am
Oops it is not working.
I am receiving many emails with this "/bin/sh: /usr/bin/GET: Permission denied" regarding the cron jobs. I thought it was working but it only got "refreshed" when I typed www.example.com/cron.php
Thanks!
I have your answer...
my fellow newbian..... (LoL)
You are in luck! I was in your shoe before and nobody seemed to understand what it means when you have no idea what these codes mean.
1) While in the "Cron Jobs" section, select either Standard or Advance
2) The minutes, hours, month, etc. should be the easy part
3) Now here's what you need to input in the command line...
cd 'type in your site path here' ; php -q 'cron.php' > /dev/null 2>&1
mine is rather lengthy, but you should get the gist of it....
cd '/.../.../.../.../rcForum/' ; php -q 'cron.php' > /dev/null 2>&1
I hope that helps you.
Diva Webmistress
http://ranchcardoso.biz/rcForum
http://bodyinparadise.com/bpForum
Thanks for the input Diva
Thanks for the input Diva Webmistress. How will I know if it is working already?
Be sure to set the cron job
Be sure to set the cron job to check for feeds every 5 minutes, then go to your log files and it should give you something like this...
cron 09/18/2006 - 10:00 Cron run completed Anonymous Visitor details
As soon as you know it's working, be sure to change your cron job to check for feeds every hour or more.
I hope it worked for you.
Diva Webmistress
http://ranchcardoso.biz/rcForum
Hi again. It does not seem
Hi again.
It does not seem to work since I am now getting these emails instead from the cron daemon "/bin/sh: line 0: cd: http://example.com: No such file or directory" .
I apologize that this is getting to be an old topic but I can't seem to make it work. Is it the host?
Thank you again.
Are you typing in...
Are you typing in "http://www.example.com" as your site path?
Your site path should be your actual website name or the root directory path from your hosting company. It's where all of your files are contained within their server.
What is your website and forum site name?
Diva Webmistress
http://ranchcardoso.biz/rcForum
http://bodyinparadise.com/bpForum
Poormanscron.module then,
Poormanscron.module then, its easy to install, no messy table, just upload it to your `modules' folder
Then admin/settings/poormanscron - set it time interval you wish
Hi. My website is
Hi.
My website is www.thewatchworks.org hosted by hostgator and I installed drupal using cpanel's fantastico. It is the latest version of Drupal.
As you may see, I have some rss feeds there which I want to automate.
Thank you.
It seems to me that you are really a Newbie
What MuslimGuy means is :
1. Download poormanscron from http://drupal.org/project/poormanscron to your desktop
2. Upload the file (the gzipped file) to drupalfolder/modules using the CPanel File Explorer
(In your CPanel find file explorer, navigate to the modules folder and then click "browse" to upload the file
when the file is in the folder click on its name and on the right side should give you an option to "extract contents" this will "unzip" the file inside the modules folder)
3. Go to your drupal admin/settings/poormanscron and configure it
--
Chios Greece sightseeings
------
GiorgosK
Web Development
That was the best solution
That was the best solution to the problem! It was that simple...LOL! Only a module was needed.
Cheers and thank you to all that helped-out!
Thank you kingeo for the
Thank you kingeo for the URL
I havent been able to memorize Drupal URLS / links to modules
Just to add...
I think Poormanscron is a bit greedy on server resources and probably not the best idea if you run it often. The Sanitycheck module doesn't like it, anyhow.
I'm on Clook (great ISP:-) and their CPanel crontab doesn't allow WGET or GET for security reasons, but this appears to work:-
/usr/bin/php -q /home/myusername/public_html/cron.php(adjust '/home/mydomain/public_html/' to suit your hosting co's server path)
However, crontab emails me each time cron.php has run and every mail contains a ton of this sort of stuff
(NB I've edited my actual 'username' out of the above)
This looks like some sort of cookies issue, through running cron.php outside a browser session (?) It doesn't seem to stop it working; Drupal Watchdog logs 'cron run completed'. Once I was sure it was working I appended '> /dev/null ' to the crontab command-tail and it is now working silently, no more emails nor log entries.
Regards
Tony Sleep http://tonysleep.co.uk
Cron cPanel and multi sub sites.
I am restricted to this method in cPanel:
/usr/bin/php -q /home/myusername/public_html/cron.phpThis only runs cron for the main site. How do I run it for a sub domain site?
--
Mr Chatter
I have subdomain sites
I have subdomain sites and the method works fine in them. Assuming your subdomain is under, let's say
/home/myusername/public_html/domain1then your cpanel entry would look like:/usr/bin/php -q /home/myusername/public_html/domain1/cron.phpanother cronjob would be set for:
/usr/bin/php -q /home/myusername/public_html/domain2/cron.phpand so on. One cron job per subdomain.
My case - shared host
This method
/usr/bin/php -q /home/cpanel_user_name/public_html/cron.php
works fine with me. If you want to be informed via email, then do not use -q
If your site is: www.domain.com/drupal, then
/usr/bin/php -q /home/cpanel_user_name/public_html/drupal/cron.php
This one is also ok:
cd /home/cpanel_user_name/public_html/drupal/ ; php cron.php
The method
GET http://domain.com/cron.php > /dev/null
works with my Ubuntu localhost, but does not work for Cpanel.
My cpanel version is 1.0.
How does this work when all
How does this work when all the sub-domains share the same code base and use /sites/domain to differentiate them? How do you call cron for each site separately?
try this:
try this for subdomain.domain.com:
/usr/bin/php -q /home/cpanel_user_name/public_html/subdomain/cron.php
You need to tell your cron.php located (drupal installed).
That isn't going to work. I
That isn't going to work. I have 4 Drupal sites all using a common Drupal install in the public_html directory. The sites are called through /sites/site1 /sites/site2 etc. All four sites use separate database tables but share the exact same cron.php file:
/home/cpanel_user_name/public_html/cron.php
It makes it a no-brainer for updating Drupal code but it's impossible to run cron for the add-on sites. How do you call cron for a specific site using /usr/bin/php (and GET / WGET don't work)?
Possible to get cron jobs to work with multi-site setups?
Is the above correct - that it is not possible to get cron to work in multi-site setup?
If so, is it possible to get around this with some programming of the script?
Do we need a combination of a modified script and a special drupal module that goes with it?
I would like to get automated cron to work on multi-site setups where most or all the sites require login to access the data.
.
--
( Evaluating the long-term route for Drupal 7.x via BackdropCMS at https://www.CMX.zone )
@halftone - totally off topic
@halftone - totally off topic but how is Clook working out, I need to switch hosts and was looking closely at Clook, are you on shared or VPS etc? I'm at Kualo right now, no probs but for various PHP5 related reasons I have to move...
/Jeff
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
more poormans cron
hi ... this was helpful to me, however, after following the instructions and installing the module, when i went to configure it it said:
warning: Missing argument 2 for drupal_get_form()
um, so where do i go from here ???
please and thanks :)
Your best bet is usually the issue queue of the specific module
So in this case visit
http://drupal.org/project/poormanscron
development > all pending issues
if you don't find anything
fill out a new a bug report or support request for pathauto 5.x
so people involved in the project can either fix the bug or
help you with your problem
GiorgosK
------
Good read for newbies > http://drupal.org/node/120612
Lots of Discussion and help is going on in http://groups.drupal.org/ too, join in
------
GiorgosK
Web Development
Worked like a charm
Thanks, worked like a charm.
To test if it is actually firing you can remove the last section - > /dev/null 2>&1 and make sure you have a good email address in your crontab section of your cpanel. Once you're happy, add in the > /dev/null 2>&1 section or just try to remove your email address - or do both.
Another way is to go into your 5.x install of drupal and look in admin -> logs -> status and see when cron last ran -- see if it updated.
First of all you have to set
First of all you have to set permission for your file to be able to execute it... then you need only this line: php -q /home/username/publi_html/file.php where username is your main user for cpanel. -q for quite mode to not return status.
Hint in cPanel
Just noticed that if hit Advanced User option in my cPanel - even tho not planning to do advanced stuff, I find:
Hint: to run PHP files, enter the command as follows (modify to fit your needs):
GET http://yourdomain.com/path_to_file/file.php > /dev/null
- didn't get such a hint with Standard skills option (err, no cron skills at all in my case, but no option for that).
- maybe handy if cron commands can differ somewhat between versions of cPanel - or (maybe happens more) between hosts, as way of checking command to use.
CheungChauHK 長洲HK - South China Sea island in Hong Kong.
____________________________
DocMartin and Hong Kong Outdoors
Finally got CRON to run under Cpanel - But...
This is the email I get..
I have obviously changed my username, but any ideas??
==================================
EDIT >>> I now have it working correctly with
cd /home/user_name/public_html/ ; php cron.phpWorks fine but took some poking and hoping until it did
Sweet!
Thanks thoughtvoid!!! The following command in cpanel 10.9.0-RELEASE in Cron Jobs under Advanced Tools worked for me too:
cd /home/user_name/public_html/ ; php cron.php
Where I changed user_name to my site's username (username used in ftp). I checked the Administrator>Logs in Drupal 5.1 and noticed the following:
cron 04/18/2007 - 21:26 Cron run completedAwesome!! Now I just need to change the time to run each hour instead of 5 minutes that I chose!
The only one that worked for me
Hi folks - I run my site as an add-on domain in CPanel. I tried everything above, and the last one is the only one that worked for me:
cd /home/user_name/public_html/ ; php cron.php
Thanks a bunch!
Yes, This one works for me
Yes, This one works for me also. Others suddenly do not work (it worked before).
cd /home/cpanel_user_name/public_html/drupal/ ; php cron.php
mysqli
I tried the above cron line, and it almost(?) works. I'm using Drupal 6 Beta 3, which may throw things off. Anyway I get the following error message in my email:
"We were unable to use the MySQLi database because the MySQLi extension for PHP is not installed. Check your PHP.ini to see how you can enable it."
I'm hosted at hostgator, and I'm not sure if I need to enable something on their end, or on the Drupal side of things.
Below are the steps to run
Below are the steps to run Drupal 53's cron.php in my cpanel
1. click on cron jobs
2. click on standard
3. set email to your dedicated email in case anything goes wrong
4. set command as "php /home/user/public_html/Drupal53/cron.php" (without double quote)
5. set the rest as Every Minute, Every Hour, Every Day, Every Month, Every Week Day
Notes :
1. user in step 4 must be your user name in your hosting package
2. Drupal53 in step 4 may not be a must but I do that because I put all Drupal files in a folder instead of my www site.
Happy Cron ^_^
Webserver
This is wrong; cron.php needs to be accessed via the webserver. Do
GET http://www.example.com/cron.php > /dev/nullorwget -O /dev/null http://www.yoursitename.com/cron.php 2>/dev/nullmentioned earlier in the thread not work for you?In desperation, one can also setup a cronjob on another system (such as http://www.webcron.org/).
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Dear Heine, Have you
Dear Heine,
Have you try on it? It works and I get Cron Status restart counting in the log's status session.
Thanks for replying.
Seems like we are rehashing
Seems like we are rehashing things a bit here, but I think the problem with GET, is that most servers don't allow it.
I know when I try it, I receive the following error:
/bin/sh: /usr/bin/GET: Permission denied
For me: cd /home/ardarvin/public_html/site2/ ; php cron.php
is the closest I've come to getting cron to run, as I at least get a drupal error response...the mySQLi error. Anyone know how to overcome this one? Again, I'm using Drupal 6, Beta 3.
cron job
"cd /home/cpanel_username/public_html/ ; php cron.php" !
Of course you have to replace cpanel_username by your cpanel user name.
We probably should take all these FAQ's and write a "how to" book for Drupal
Thank you! all
Cron Permission denied
I have Drupal 6.2 running and followed the instructions per David Mercer's Drupal 6 book which says to open the cpanel and insert:
/usr/bin/lynx -source http://www.mysite.org/cron.php
and asked email be sent to me per cron job.
I too received: /bin/sh: /usr/bin/lynx: Permission denied
There are several variants posted here and I was wondering if someone could point out which one I should use?
Got it working
I believe I tried every answer here but the only one that worked is:
cd /home/cpanel_user_name/public_html/ ; php cron.php
Thanks all
Hopefully I haven't open some huge security hole!
that worked!
That worked just fine for me: "cd /home/cpanel_username/public_html/ ; php cron.php"
Thanks!
Using CURL for cron
I have found you can also use CURL to call the URL for cron.php
This means you can set up a separate cron job for each multisite domain/subdomain
Try it first without the -s switch (silent) to see that it is working or with a -v switch for verbose output.
Noel
subcrip
subcrip
CURL Worked For Me
I use cpanel, and this is what ended up working for me. I've got several subdomains to run cron on.
command: /usr/bin/curl -s http://subdomain.example.com/cron.php
wget worked for me
I tried to follow all the help about this but because of the difference between setups in the hosts I only got there by trial and error, using examples and help files wherever I could find them. It took 10 goes until the mails I got back (set up through cPanel) stopped having various errors:
For me, hosted at x10hosting, in cPanel, the command that works is:
wget http://mydrupalusername:mydrupalpassword@example.com/cron.php
It was very frustrating but the system was very good at sending feedback by mail.
Hope that helps someone!
This is what worked for me
I tried to follow all the help on this site and I found that this worked on my hosting and different hosting accounts of my friends:
php -f /home/CpanelUsername/public_html/site/cron.php
let me know if it works.
Poorsmanscron critical bug - what to do?
Hello everyone,
Just need a bit of a hand, I was running my cron jobs using poorsmancron but web hosting company has said
They have also recommended two different ways for the command to run to enter in Cpanel
I have tried using both options but in both cases I get an email saying "No input file specified."
I have written
*/15 * * * * /usr/bin/curl -s http://mywebsite.com.au/cron.phpand
/usr/bin/php -q /home/mywebsite.com.au/public_html/cron.phpWhat am I missing that the cron.php file that is located in my root folder is not running?
If I run mywebsitename.com.au/cron.php from my browser, the cron job runs fine.
Thanks in advance for any help.
Raul
Raul
raulcaceres.me
This is the only one which
This is the only one which worked for me - must be the same sort of setup in the host. Thanks :)
Cron Jobs on Hostgator Hosting
I use Hostgator for my hosting. I have only one account with them. So I have my principal account and my other domains are implemented from my principal account (we can set up unlimited other domains with only one account). I could get cron jobs working without any problem. I'll first explain how my site is set up, then will provide the commands for the principal domain, and for the other domains that are implemented as subdomains.
For this post let's assume my principal domain name is principalD.com
let's assume my other domain name is otherdomain.com
First I created a subdirectory called drucms in my public_html account where I installed my drupal files. Then I created in public_html a file called index.php that redirects to "http://principalD.com/drucms/" so I can keep my public_html directory clean and could easily add other applications later on. The cron command for this domain is:
/usr/bin/wget -O - -q "http://principalD.com/drucms/cron.php" > /dev/null 2>&1
I set it to run hourly.
now for my other domain which is installed
My other domain is installed in my primary domain under "public_html/otherdomain.com". To keep things clean and neet I created another subdirectory "public_html/otherdomain.com/drucms" and installed my drupal files there. I created a file index.php under "public_html/otherdomain.com" that redirects to "http://otherdomain.com/drucms/".
The cron command for this domain is:
/usr/bin/wget -O - -q "http://otherdomain.com/drucms/cron.php" > /dev/null 2>&1
and it works for me. Hope this can help others.
Cron jobs at hostgator
had the same issue and filed a ticket at hostgator
the right command would be:
cd /home/[username]/public_html/; ../../../usr/local/bin/php -q cron.php
for a drupal installation at the root of the server,
hope this helps
This what worked for me:
This what worked for me:
wget http://mydrupalusername:mydrupalpassword@example.com/cron.php
Thanks!
So many way to cron it's confusing!
This method worked for me on shared hosting with hostgator:
wget http://username:password@domainname/cron.php >/dev/null 2>&1BUT a new cron text file gets left in my root directory everytime cron runs which I found annoying so I ended up using this method that works perfectly and directs all output to an error log instead of email:
php /home/myaccountname/public_html/cron.php >> /home/myaccountname/error_log 2>&1Great! that was very
Great! that was very helpful...
The Official HostGator Support Link for Cron Commands
Should anyone need it here is HostGator's link to cpanel cron commands.
http://support.hostgator.com/articles/cpanel/what-do-i-put-for-the-cron-...
antoher way - worked for me with linux
/usr/local/bin/php -q /home/username/public_html/cron.php
curl -s -o /dev/null
Does anybody know how to run this kind of cron job script in cpanel?
curl -s -o /dev/null http://www.domain.com
Thanks for help!
My 5 cents...
This worked for me like a charm - setup this command to run from the Cron :
php /home/[your username]/public_html/yourdomain.com/cron.phpcronjob at cpanel
I set a cronjob at cpanel, but it does not run at all. I am sure that my command is correct since I have tested by running the command manually.
I am curious or should I set it at root panel? Please advise.
Running Cron from cpanel
Hi, I am a total newbie but I think I found the solution to run cron for Drupal 7 from cpanel (I am hosting with Goddady):
First, you log in as administrator to your Drupal 7 site.
You go to Configuration / System / Cron
Then copy the URL that is after the text "To run cron from outside the site, go to"
Then log in to your cpanel on Goddady, go to where you need to put the command line to run your cron job and write
curl [paste link here]
(Without the [])
It worked!
You can check it works when you go back to Drupal / Configuration / System / Cron.
It will tell you the last time it was run. Try setting it up for a frequency of 5 minutes at the beginning to check it.
Good luck!
Holy cow!
It's remarkable that here in 2018, decent instructions (for newbies), is still not available. I've searched for days for the right way to set up cron in cpanel and FINALLY I find the best answer in the very last comment of a 12 year old thread...from a newbie!! For what it's worth, because I don't even know if anyone is still alive in this thread, thank you! And thank you, fabitas!
Drupal, in regards to your help files, please keep in mind that your audience is not all techies! Some of us just want to be webmasters and not Drupal engineers.
=-=
unsure why https://www.drupal.org/docs/7/setting-up-cron-for-drupal/configuring-cro... didn't work as documentation?
This was one of this first
This was one of this first docs I found. I had been looking for command examples to use in cpanel. I got to:
How to set up a cron job
"...if you manage your website through a web-based control panel such as cpanel, Plesk, or Virtualmin and Webmin, you will use the web interface."
and went to the cpanel link provided. After getting frustrated with that documentation I completely forgot about the rest of your referenced document.
I just finished it and see that it answers my question nicely. Bad on me, and I retract my comment on Drupal.
I'm glad you came back to post that link. Thank you.
Thank. YOU. This is the only
Thank. YOU. This is the only one that would work on my Hostgator reseller shared hosting. You are a life saver!