Quantcast
Channel: Byte Miner » admin
Viewing all articles
Browse latest Browse all 12

Monitor URL using cron job

$
0
0

Simple cron job to monitor a URL and notify via e-mail if no response is received.

You can use cPanel to set these, enter the following:

wget --no-cache --spider www.google.com &> /home/user/tmp/mail.txt || mail -s "Google website down" admin@google.com < /home/user/tmp/mail.txt

And run, say every 5 mins. Job done!

N.B.: If adding this via cPanel, you need to create the mail.txt at the specified location using file manager and set permissions to ’777′ for this to work properly.

The post Monitor URL using cron job appeared first on Byte Miner.


Viewing all articles
Browse latest Browse all 12

Trending Articles