What is the right cron job command


#1

Hi,

What is the right cron job command to run these urls once a day:

http://example.com/wp-cron.php?import_key=etCacQiuod&import_id=10&action=trigger
http://example.com/wp-cron.php?import_key=etCacQiuod&import_id=15&action=trigger
http://example.com/wp-cron.php?import_key=etCacQiuod&import_id=9&action=trigger
http://example.com/wp-cron.php?import_key=etCacQiuod&import_id=16&action=trigger

Thanks,
Stathis


#2

You can use the following to run the command once a day:

0 0 * * * curl -s "http://example.com/wp-cron.php?import_key=etCacQiuod&import_id=10&action=trigger" > /dev/null 2>&1

Repeat for each URL


#3

Hi @MarinT,

thanks for the reply,

i asking because i experience troubles with the command i used which is:

0 0 * * * wget -O /dev/null “http://example.com/wp-cron.php?import_key=etCacQiuod&import_id=10&action=trigger” > /dev/null 2>&1

can you please tell me the difference between wget -O /dev/null and curl -s

Thanks,
Stathis


#4

You can use wget and curl also in crontab

Example :- 0 0 * * * wget URL
0 0 * * * curl URL