I can't seem to get the Scheduler module to automatically publish content. I've created a cron job using 'crontab -e', and the file looks like this:

* * * * * wget -q -O /dev/null "http://www.mydomain.com/scheduler/cron"
(substituting mydomain.com for my company's actual domain name)

The scheduled content shows up on the "Scheduled Content" tab under Admin>Config>Scheduler. But several minutes after the scheduled publish time, the content still appears as unpublished.

If I manually run the lightweight cron by clicking the [Run Scheduler's lightweight cron now], the content gets published. So this had me looking at my cron job for a possible problem. But when I check /var/log/cron, I see that the cron is running every minute. Here's the last several lines from /var/log/cron:

May  7 14:36:01 www CROND[26227]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:37:01 www CROND[26240]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:38:01 www CROND[26251]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:39:01 www CROND[26301]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:40:02 www CROND[26318]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:40:02 www CROND[26319]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May  7 14:41:01 www CROND[26344]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:42:01 www CROND[26359]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")
May  7 14:43:01 www CROND[26371]: (root) CMD (root /usr/bin/wget -O - -q /dev/null "http://www.domain.com/scheduler/cron")

(again, I've substituted my actual domain name with the "domain.com" placeholder.

So I know the following:

  • Running Scheduler's lightweight cron manually (via the button) works correctly - any content that should be published is published
  • My scheduled cron is running once per minute, and the syntax I've used is identical to that provided on the "Lightweight cron" tab
  • My scheduled cron job does not publish content that is scheduled to be published.
  • I've tried using both the wget and curl commands in my scheduled cron job, but neither seems to get the job done.
  • Drupal's standard crontab job is set to run every hour. When it runs, it will publish any content that is scheduled to be published.
  • The information on the "Time Check" tab is correct. I'm at -04:00 EDT America/New_York. The local time is also reported correctly on this tab as well as on the server.

I'm really not sure what's going on here. Any help would be greatly appreciated.

Thanks in advance!

Comments

pfrenssen’s picture

What happens if you log into your server as root and execute that wget command? Do you get an error or a 200 OK?

Did you set up an access key?

You can set an option in the Scheduler lightweight cron configuration screen to log every action. Can you enable this and the "Database logging" module and then check the watchdog to see if Scheduler is running the lightweight cron?

Configuring cron on your server is outside of our scope, but you can find a lot of information in the section on configuring cron for Drupal. It has a wealth of information on how to set up cron on various systems, how to troubleshoot it, alternative commands to use etc. I can recommend to read through it.

pocketsidewalk’s picture

What happens if you log into your server as root and execute that wget command? Do you get an error or a 200 OK?

I'm getting a "403 Forbidden" error.

Did you set up an access key?

Not at first. I tried using an access key after I saw that I was getting the 403 error, but this didn't fix the problem.

Now I've got to figure out what's causing the "403 Forbidden" error.

pocketsidewalk’s picture

Switching to curl with the access key seems to have fixed the issue. Running curl directly from the command line yields no errors. Cron runs successfully, and articles are published and unpublished at the times specified with scheduler.

Thanks for your help pfrenssen!

pfrenssen’s picture

Status: Active » Fixed

Perfect, glad you found a solution!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.