Reputation: 307
i need to create cron job to run URL from Cpanel every minute
when i open the link from browser it's auto generate backup for database
i choose the common setting ( once per minute ) * * * * *
and this is the command i use but no one worked
GET http://example.com/backup > /dev/null
wget http://example.com/backup
curl -s http://example.com/backup > /dev/null
wget -q -O /dev/null "http://example.com/backup" > /dev/null 2>&1
this is my references
https://forums.cpanel.net/threads/cron-job-to-call-a-web-page.60253/
Using CRON jobs to visit url?
CRON command to run URL address every 5 minutes
Upvotes: 10
Views: 34064
Reputation: 475
For Cron job to work you just need to hit the url, without any output and without downloading anything.
I am using only the wget with this two parameters:
wget -q --spider https://example.com/
Documentation: https://www.gnu.org/software/wget/manual/wget.pdf
Upvotes: 1
Reputation: 551
Alternative try this
curl -s https://example.com/cron
don't forget to add the HTTP or HTTPS protocol
Upvotes: 5
Reputation: 61
wget -q -O /dev/null "http://example.com/backup" > /dev/null 2>&1
Upvotes: 2
Reputation: 110
You can use "links" command like:
links https://www.honeymovies.com
Upvotes: 1
Reputation: 456
use this
wget -q -O - http://example.com/backup >/dev/null 2>&1
instead of
wget -q -O /dev/null "http://example.com/backup" > /dev/null 2>&1
Upvotes: 19