Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup a wget cron job command

Tags:

linux

php

webmin

How to setup a cron job command to execute an URL?

/usr/bin/wget -q http://www.domain.com/cron_jobs/job1.php >/dev/null 2>&1

Why can't I make this work!? Have tried everything.. The PHP script should send an email and create some files, but none is done

The command returns this:

Output from command /usr/bin/wget -q http://www.domain.com/cron_jobs/job1.php ..

No output generated

... but it still creates an empty file in /root on each execute!? Why?

like image 805
clarkk Avatar asked Nov 09 '11 10:11

clarkk


1 Answers

Use curl like this:

/usr/bin/curl http://domain.com/page.php

Don't worry about the output, it will be ignored

like image 105
Ivan Avatar answered Sep 24 '22 14:09

Ivan