Cron job to process files

Status
Not open for further replies.

siniztr

Verified User
Joined
Dec 17, 2016
Messages
27
Location
Netherlands
Good day,
I am busy setting up a photography site for my dad, and the plugin that I use in wordpress requires me to set up a cron job to process the photos that are uploaded. While I do know a lot of the ins and outs of directadmin, I never had to create cron jobs. While going over some of the descriptions for setting up cron jobs, they all refer to files for the cron job, e.g. /home/user/domains/domain.com/public_html/file.php. But the plugin gives me the address for the cronjob to run, and it isn't an actual file, but a web address.

I have tried entering it in as the plugin recommended, but it doesn't seem to work. If I go to the address the address works fine. The full command they want me to put in is
Code:
curl -silent -A 'Mozilla' 'http://www.**domain removed for privacy**.com/?c=1&ss_c=782f0decfa75a2c5a2c7' >/dev/null 2>&1
I have tried adding just the address into the cron job, I tried adding the /usr/local/bin/php before it, and tried putting in the entire command they gave, but not getting it to work. Any ideas?
 
Hello,

add the code exactly how it's written in the "command" input field in Directadmin. It should run fine.

Related: http://site-helper.com/misc.html#cron

You might consider adding it without ">/dev/null 2>&1":

Code:
curl -silent -A 'Mozilla' 'http://www.**domain removed for privacy**.com/?c=1&ss_c=782f0decfa75a2c5a2c7'

to receive emails with results/errors.
 
Maybe your Hosting Provider is blocking outgoing connections, you may need to contact them for infos.
Another thing you can do is remove >/dev/null 2>&1 to receive an email with the output, it may help you debug.
Also, i'm not really sure you need -A 'Mozilla', it should work also without that.

Best regards

PS. Please do not double post. I'm gonna remove the other thread where i did originally replied.
 
Sorry for the double post, when I posted it I didn't see the part that the post would only be made visible after it is approved. Apologies.
I have the job in as stated, but the cron job doesn't seem to be running. And I am not getting any emails with errors. Is there somewhere that I have to turn on the jobs?
 
Kindly post here a screenshot of the page from Directadmin with the cronjob.
Also check cron logs
 
Sorry for the crappy cover job, am also dealing with a issue with a website that I administer.
I didn't see an option for including the screenshot, so here is the link to it
cronjobs.jpg
 
Via another forum, one for the plugin directly, I got the tip to use /usr/local/bin/curl instead of just curl and now I am getting emails stating that the cronjob is running fine.
So the code is
Code:
/usr/local/bin/curl -silent 'https://www.**domain removed for privacy reasons.com/?c=1&ss_c=782f0decfa75a2c5a2c7'
 
Status
Not open for further replies.
Back
Top