View Full Version : CRON with 3.0
ccolvard
05-21-2006, 09:12 PM
How do I set up cron for my feeds.
It works through the browser using:
/news/admin/rss_import_feeds.php?r=1
On the host using cPanel on command line:
[ lynx url_root/news/admin/rss_import_feeds.php?r=1 ]
Am I using the the correct update file and commands?
Thanks,
Chris
[/SIZE]
David
05-21-2006, 09:18 PM
Try turning off page compression in admin
(one idea)
I'm not an expert on terminal stuff though.
ccolvard
05-21-2006, 09:22 PM
Is [ rss_import_feeds.php?r=1 ] the correct file and param to use?
Or is it [ dir_links_importrss.php ] and what is param?
Thanks,
Chris
David
05-21-2006, 10:16 PM
You want rss_import_feeds.php?r=1
David
05-21-2006, 10:18 PM
This one may be dated, but it may help some:
http://www.phplinkdirectory.com/forum/showthread.php?t=2662
ccolvard
05-22-2006, 12:30 AM
Hi David:
None of the above items have worked.
I am on a Lynx sever running Cpanel. The script works fine, but no method of cron seems to work.
PHP is called using CGI according to the following:
root_url/news/admin/phpinfo.php
The install recorded this problem with server API:
root_url/news/install/index.php?step=2
Tech Support says to run the lynx command to run the script:
Have tried all of these:
[lynx root_url/news/admin/rss_import_feeds.php?r=1 ]
[lynx -dump root_url/news/admin/rss_import_feeds.php?r=1]
[lynx -dump root_url/news/admin/rss_import_feeds.php?r=1 >> /dev/null]
Also tried without ?r=1 param
Have changed permissions to the file as 644, 755 & 777
Still nothing works.
The script works fine from the browser:
root_url/news/admin/rss_import_feeds.php
ISP says there is something wrong with the script. That it should not output anything to screen/browser while running cron. That's why I tried using dev/null param above.
I suspect the problem is with the install error above, is there a work around for this?
Thanks,
Chris
David
05-22-2006, 12:55 AM
I don't know if this is an acceptable solution, but if you don't want to have to deal with figuring out what is going wrong with the cron, you can also setup a scheduled task from your windows home computer to simply visit that url. Also, you might want to try asking your host. I will see if I can setup a cron meanwhile on my hostgator cpanel account.
ccolvard
05-22-2006, 01:30 AM
Hi David:
I'll talk to the host, but they are not very helpful.
Maybe some other forum members can help with a work around.
I would like to know what the correct output email from a Cpanel & Lynx looks like. I've got a number of messages that should be able to get to the bottom of it.
I've got it to display the contents of the file, the comment section. I'm sure there is a way to run the script if the file can be displayed. I just don't know all the params to do it.
Several forum members know alot more than me about this.
Thanks for your help.
Chris
meandean
05-28-2006, 06:28 AM
Content visible to registered users only.
Chris ... here are some of the more common options - so if your host won't provide you with one browsing tool, perhaps they have already installed some other ...
here are some choices:
/usr/bin/curl -s "http://<domain>/admin/rss_import_feeds.php?r=1" -o /dev/null
/usr/bin/lynx -source http://<domain>/admin/rss_import_feeds.php?r=1 > /dev/null 2>&1
/usr/bin/wget -q "http://<domain>/admin/rss_import_feeds.php?r=1" -O /dev/null
Any one of these three will get the job done.
good post meandean.
also note that the php path may be required on some hosting for the cron to work.
srikondoji
05-28-2006, 03:51 PM
I only have windows scheduler option.
Can anybody provide me a batch file so that i can make my windows schedulaer run the php script to import feeds?
Thanks
David
05-28-2006, 04:03 PM
What I have done in the past is run a scheduled task to open that url once per day from my home computer.
meandean
05-28-2006, 05:08 PM
Content visible to registered users only.
With a windows scheduler, may I suggest installing WGET (http://users.ugent.be/~bpuype/wget/) for Win32?
Since wget is command line program, you can roll it into at batch file that you can then call via a timer using the following syntax:
c:\<path>\wget "http://<domain>/admin/rss_import_feeds.php?r=1" -O NUL
NUL being the ms-dos equivalent of linux' bitbucket /dev/null for output.
I have never heard of not being able to cron with any hosting.
who is your hosting with?
srikondoji
05-29-2006, 06:09 AM
Unless i upgrade my hosting, they won't give me cron access.
My hosting provider is godaddy.
Their tech support sucks big time.
ccolvard
05-30-2006, 11:07 PM
Thanks for all of the replies everyone!
(I am hosted with Penguin Web Hosting)
Here is how I solved the problem:
Followed this tutorial: http://techpatterns.com/forums/about399.html
Using SSH find results for:
whereis sh
whereis wget
Created an sh file as described in tutorial, contents as follows without brackets:
Line 1 [ #!/bin/sh ]
Line 2 [ /usr/bin/wget -t 15 --delete-after root_url/news/admin/rss_import_feeds.php?r=1 -a /home/hostingaccount/sh_scripts/wgetlog.txt ]
NOTE: You do not have to write the log file which is everything after ...feeds.php?r=1.
The above script tries 15 times to complete the update, deletes any output (runs quiet) created by script and writes operation to a log file so I can double check things for the next few weeks.
Tested script in SSH using without brackets:
[ /bin/sh /home/hostingaccount/sh_scripts/cron.sh ]
After everything is working enter the following code in CPanel cron standard, command to run:
without brackets
[ /bin/sh /home/hostingaccount/sh_scripts/cron.sh ]
set update times, etc...
Works great with no errors.
Thanks,
Chris
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.