0

I'm running drupal 7 on a shared host with cpanel and apache. I don't want to use regular cron because i want to run some tasks more regularly than others such as the search index. So i added Elysia Cron module. It doesn't run at the regular intervals I intend though. I'm hoping you all can give me some guidance. Here's how I set it up:

I added a cron job in my cpanel like so:

http://mysite/sites/all/modules/elysia_cron/cron.php?cron_key=key and set the frequency to *****.

Then in Drupal I went to admin > configure > elysia cron and did the following:

Set search to run every 15 minutes and everything else either every hour or every day.

I also set the installation settings so that 'never/use external crontab' is selected for 'run cron on visitor's requests, every'.

But when I save these settings...cron doesn't run every 15 minutes for the search index as planned.

Any idea what else I might need to change?

  • Frequency ****** in this context means: "ping Elysia Cron every minute", so as described, this should work. Does Elysia Cron run at all? And if the answer is yes, at what frequecies? Are you using the actual key hash (and not literally the string key) in the cpanel setup? – Free Radical Jun 12 '15 at 7:58
  • @Free Radical Thanks for your response. Yes, Elysia Cron runs manually if I tell it to. I don't know what 'interval' it's running at as I just enabled it tonight. It ran after I enabled it. I'm using the string key literally...I didn't realize that was wrong. I removed the key entirely however and Elysia cron still doesn't run every 15 minutes as intended. – Sage Jun 12 '15 at 8:10
2

Given the explanation in your question about how you've set things up, at least one reason your external cron does not ping Elysia Cron is that you've got the key wrong, or that the key is missing.

You need to up look the right key. Navigate to Elysia » Settings » Installation Settings » Cron key and copy the key has you find there so that your Cpanel setup to looks like this:

http://example.com/sites/all/modules/elysia_cron/cron.php?cron_key=ZvMtg5HAaRzjz5NtkwoDs0F3jOWrbpIX5JVi3ACJl7Q

Note: Use the actual key you find on your site - not the dummy key I use as an example.

  • that's what I had originally and it doesn't work. I'm using the key specified in Elysia > Settings > Installation Settings > Cron key. It's super long like the one you mocked up above. – Sage Jun 12 '15 at 9:05
  • 1
    I can guarantee that it won't work without the right key. I am surprised to learn that it don't work with right key. – Free Radical Jun 12 '15 at 9:08
  • It might be because I'm testing this on a subdomain: staging.mysite.com/thepathtocron. I tried changing it to wget urltocron > /dev/null and now cron is running (according to my cpanel and the constant emails I'm getting) every minute. But on Elysia in Drupal it's not saying it's updating. The emails I'm receiving are also giving me this error: Connecting to www.site.com|104.28.4.111|:80... connected. HTTP request sent, awaiting response... 403 Forbidden 2015-06-12 03:46:02 ERROR 403: Forbidden. >> not sure what that means. – Sage Jun 12 '15 at 9:48
  • 1
    403 means "Access denied". Looks like it is not allowed to access the URL to ping Elysia cron. – Free Radical Jun 12 '15 at 9:52
  • Interesting. The rest of the error message before that part shows it trying to connect with www.sitename.com, connecting and then http request sent, awaiting response, followed by 301 message. It then connects to just sitename.com (without www), the same thing happens and so it ends with www.sitename.com again. Any idea why this might happen? – Sage Jun 12 '15 at 20:47
0

As described also in Configuring cron jobs using the cron command, what the Cron daemon wants is a command to execute. You cannot simply put the cron URL for the Drupal site.

If Wget is installed, you can use /usr/bin/wget -O - -q -t 1 http://CRON_URL > /dev/null 2>&1. If cURL is installed, the equivalent of that command is /usr/bin/curl --silent --compressed http://CRON_URL > /dev/null 2>&1. Replace /usr/bin/ with the directory containing the executable, and CRON_URL with the right cron URL, which for the Elysia Cron module includes sites/all/modules/elysia_cron/cron.php.

Keep also in mind that the Elysia Cron module, like Drupal Cron, requires CRON_URL includes the cron key given in its administration form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.