Using CRON jobs to visit url?

Trainee Asked on October 10, 2019 in Cpanel.
Add Comment
1 Answer(s)
* * * * * wget -O - http://yoursite.com/tasks.php >/dev/null 2>&1

That should work for you. Just have a wget script that loads the page.

Using -O - means that the output of the web request will be sent to STDOUT (standard output)

by adding >/dev/null we instruct standard output to be redirect to a black hole. by adding 2>&1 we instruct STDERR (errors) to also be sent to STDOUT, and thus all output will be sent to a blackhole. (so it will load the website, but never write a file anywhere)

 

Reviewer Answered on October 10, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.