Sometimes you need a simple log to know when a site is up or down.
Create a script like below and then put it in your crontab.
#!/bin/bash echo 'Begin ping' if ping -c 1 kittell.net &> /dev/null; then echo "$(date "+%Y-%m-%d %H.%M.%S") - Success" >> /var/log/web_ping.log else echo "$(date "+%Y-%m-%d %H.%M.%S") - Error" >> /var/log/web_ping.log fi
sudo crontab -e # Check every minute * * * * * /var/scripts/web_ping.sh
Last Updated on August 17, 2024