Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cron job to run url cpanel

Tags:

cron

cpanel

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

like image 842
Mohamed Mehanny Avatar asked Oct 18 '16 09:10

Mohamed Mehanny


People also ask

What is the use of * * * * * In cron?

It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week . 0 1 * * * - this means the cron will run always at 1 o'clock. * 1 * * * - this means the cron will run each minute when the hour is 1.


2 Answers

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
like image 74
Saeed Awan Avatar answered Oct 20 '22 19:10

Saeed Awan


wget -q -O /dev/null "http://example.com/backup" > /dev/null 2>&1

like image 21
saeid sayadi Avatar answered Oct 20 '22 17:10

saeid sayadi