For more how-tos and advice, return to How Do I …?
Q. How do I set up a cron job to check my feeds for updates?
A: First, let’s talk about what you need to put in your crontab file. If you don’t know what a crontab is, or don’t know how to edit yours, I’ll talk about that below. If you do know what a crontab is, and know how to edit or add jobs to yours, the main thing you need to know is that you can perform scheduled updates by sending regularly-scheduled HTTP requests to your blog’s URL with a GET parameter set to update_feedwordpress=1. So, for example, if your blog is at http://example.com/, then inserting the following line in your crontab:
*/10 * * * * /usr/bin/curl --silent http://example.com/?update_feedwordpress=1
will check in every 10 minutes and check for updates on any feeds that have been marked as ready for polling. (Note that this does not mean that all your feeds, or any of your feeds, will be polled for updates once every 10 minutes. What happens once every 10 minutes is that FeedWordPress will check whether any feeds are ready for polling, and if so poll them. Feeds typically get marked as being ready to check again about 60 minutes after the last time that they were checked for updates.)
How to edit your crontab
A crontab is a plain text file used by the Linux/Unix cron service to run commands according to a fixed schedule. (Since cron is designed for tasks that need to be executed repeatedly at a certain time or date, it is typically used to schedule regular maintenance tasks. In this case, we want to use it to schedule the task of telling FeedWordPress to check for feeds that need to be polled for updates.)
Every crontab contains a series of lines, with each line representing a cron job — which means a schedule (expressed as a series of numbers), and a command line to execute according to that schedule. The line you see above tells your web server to execute the command /usr/bin/curl with the arguments --silent http://example.com/?update_feedwordpress=1 once every 10 minutes.
The best way to edit your crontab depends on the resources that your web host provides. If your web host provides shell access, you can log into your shell account using ssh and just issue the following command at the command prompt:
$ crontab -e
If your host does not provide shell access, then your host is a bad web host. But oh well; sometimes you have to deal with bad web hosts. Some web hosts try to make up for not offering shell access by providing administrative interfaces on the web, such as cPanel or custom web-based Control Panels
. If your web host offers cPanel, you can use this tutorial on creating cron jobs in cPanel. If you’re using DreamHost, they have a Wiki page with a lot of information on setting up cron jobs from their administrative tools. If you’re unsure, the best thing for you to do is to contact your web hosting company’s technical support, and ask them how to set up a cron job to run maintenance tasks for your website.
Does that answer your question? If not, use the Talk page to comment on this post or contact me by e-mail for help. Be sure to describe what you are trying to do, and the problems you are running into, with as much detail as possible.
For more how-tos and advice, return to How Do I …?
Hi you. Does FeedWordpress provide a easy way to integrate Webcron to do cron job just like Wp-o-matic. I found that way is very useful. Which url will I fill in Webcron interface? Thanks in advance.
I tried setting up a cron job and GoDaddy and it doesn’t seem to be updating. GoDaddy does support curl on my server, so now I’m at a lostt. Please help?
Ashleigh,
Could you paste in what you are using for the cron job to update FWP? If I have a specific command line to work with, it’ll help a lot in trying to troubleshoot where the problem might be.
Sure. Here’s what I’ve got in the command line: */10 * * * * /usr/bin/curl –silent http://ashleighdickins.com?update_feedwordpress=1
I originally had frequency set for hourly at the top of the hour but when trying to work it out I’ve moved it around on the minutes to see if it worked, but I intend for top of the hour.
I thought I had replied, but now, not seeing it, I’m confused and can’t remember?
Has there been any progress figuring out what the problem is with GoDaddy accepting a Cron Job for FeedWordPress?
I saw there was an upgrade just put out so I upgraded and I received this error:
Warning: require_once(/home/content/t/h/e/thedickersons/html/ashleigh/wp-includes/class-simplepie.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/t/h/e/thedickersons/html/ashleigh/wp-includes/class-feed.php on line 4
so if I do an update via: http://mywebsite.com?update_feedwordpress=1
it works fine – in the browser
it also worked fine on my old host that uses fantastico (web tool) to set up cron jobs
on my new host I am not sure what is wrong – it is executing, but the output of the cron job is my home page.
I have tried curl, /usr/bin/curl, no luck.
When I use scheduled updates my feeds update fine but I tried moving to the cron tab and it fails to update.
When I put http://www.mysite.com/?update_feedwordpress=1 into my browser as a test it returns a blank page. Is this correct or should it display a result when I run that page? I am just trying to troubleshoot.
Many thanks
Ian
I have 50 feeds and I want to set a cron job for each feed. Is it possible to update a specific feed with a cron job? Can we use feed id or feed uri [http://www.mysite.com/feed] in the GET parameter update_feedwordpress=1 ? Thanks.
I have hundreds of feeds using feedwordpress, and have a dedicated server wishing to stage when the feeds are updated, like every 24 hours to 36 hours and stagger when they check for updates. Question is I don’t know how and am not advanced technical person. Please advise.. Thanks
Running a cron job on http://example.com/?update_feedwordpress=1 (substituting the real URL for example.com of course) gives a Not Found message, and hitting that page via the browser seems to do nothing – i.e. no new posts get brought in. However, manually pushing the Update Now button works fine, as does changing the setting to update on page load. But it’s kinda important for me to get the cron job working, so wondering if there’s any possibility of there being another URL? Scratching my head on this one…
I have the same problem. Have you resolve it ?