Cron Job

Status
Not open for further replies.

weeklyca

Member
Messages
33
Reaction score
0
Points
6
Have to add a cronjob for my SNAP plug in. Don't care if it triggers every 5 or 10 min. Telling me commands should be
curl -s -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64)" http://weeklycalendar.info/wp-cron.php?doing_wp_cron

or

wget -O /dev/null http://www.weeklycalendar.info/wp-cron.php?doing_wp_cron

Not getting emails either way. Do you know a way to express the command line so that it fires and emails me?
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You'll have to go through PHP rather than trying to issue shell commands. If that page is local to your account (as your username seems to indicate) then you'd use something like /usr/local/bin/php /home/weeklyca/wp-cron.php?doing_wp_cron. If it's external, you'd need to have a local page that does the curl and would still need to go through PHP.

Do note, though, that "fires" and "emails me" are orthogonal issues, so getting your cron to run doesn't necessarily mean that you'll get emails out of the deal.
 

weeklyca

Member
Messages
33
Reaction score
0
Points
6
/usr/local/bin/php /home/weeklyca/public_html/wp-cron.php?doing_wp_cron 2>&1 >> /home/weeklyca/public_html/cron_output.log

????


Do I have to use
public_html

And
Can I have 2 cron jobs -a cron set for every 5 mins and and one 12 min with a x10 free account?

This is what the output log is saying.
Could not open input file: /home/weklyca/public_html/wp-cron.php
Could not open input file: /home/weklyca/public_html/wp-cron.php
Could not open input file: /home/weklyca/public_html/wp-cron.php
Could not open input file: /home/weklyca/public_html/wp-cron.php
 
Last edited:

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You're allowed one cron every five minutes, max. You'd need to adjust the schedules of multiple crons so that no two runs ever happen less than five minutes apart.

I can't tell you what's wrong with the run; I don't have filesystem access to your server.
 

Anna

I am just me
Staff member
Messages
11,738
Reaction score
579
Points
113
This is what the output log is saying.
Could not open input file: /home/weklyca/public_html/wp-cron.php
Could not open input file: /home/weklyca/public_html/wp-cron.php
Could not open input file: /home/weklyca/public_html/wp-cron.php
Could not open input file: /home/weklyca/public_html/wp-cron.php


You have the username part of the command misspelled (missing an e), according to what you have from the logfile, so you should start by checking the command.

Yes, if the file you want to run is within public_html, you need to have that as part of the path, cron can run files from other locations though.
 
Status
Not open for further replies.
Top