0

EE 5.3.0

I have a feature that compares and updates data from different services using various APIs. I set it up to trigger based on url ACT id and a key. The script works fine and now I want to make it run automatically two times per day.

To do this I wanted to use a cron job. My webserver is HostGator, dedicated server, which has a cron job section in the cPanel. I've set up a test to run every minute and return the results to me via email. This is not working and I have changed the command to many different things, none of which work.

The script is set up to return a reply of testing when there is the ACT ID and the key of test in the url, so https://www.domain.com/ACT=42&key=test prints testing.

I've tried setting this up as a cron job using cURL in several different ways.

curl --silent --compressed https://www.domain.com/ACT=42&key=test

curl -s "https://www.domain.com?ACT=42&key=test"

curl "https://www.domain.com/ACT=42&key=test"

Nothing is sending an email so I have no idea if this is even working.

When I contacted HostGator support the rep gave me a bunch of links on how to set up a cron job, which didn't help. I've done this before on a shared HostGator server for an import addon and it worked fine, ran the script, got the email, etc. But for this I'm not getting anything and I'm at a bit of a loss.

Any help would be greatly appreciated.

1

After confirming your extension is installed with module.

Have you registered your action in table exp_actions? If no, then first register your action with respected method name. If yes, then make sure method name which you've specified in the exp_actions should be declared in the mod.plugin_name.php. And check with just echoing sample text. After confirming this you can go for setting up CRON.

And, that method is accessible with website_url/?ACT=your_action_id. Same url you've to add it into the CRON job and check accordingly.

Try by setting your CRON URL by below way:-

wget https://domain_name.com/index.php?ACT=action_id &> /dev/null

I hope it will works for you.

  • Thanks for the reply Harsh. I'm not sure what the issue is with this. It is possible the functions simply aren't returning any data in a way that the cron would recognize and send an email -- I have it printing out a series of responses based on the results of the feature, and while these work on the page I'm not getting anything back from the cron. I readily admit I'm not a skilled developer in Linux task scheduling. – Shayne Feb 10 at 17:39

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.