This repository contains two examples of how to monitor google.com every 5 minutes using a Bash script and a Go application.
- Save the Bash script from
check_google.shin this repository. - Make it executable:
chmod +x check_google.sh
- Open the crontab file:
crontab -e
- Add the following line to run the script every 5 minutes:
*/5 * * * * /path/to/check_google.sh >> /path/to/check_google.log 2>&1
The output of the script will be saved in check_google.log.
Option 1: Run directly:
go run main.go >> go-cron-check.log 2>&1 &Option 2: Build and execute the binary:
go build -o go-cron-check
./go-cron-check >> go-cron-check.log 2>&1 &The output of the Go application will be saved in go-cron-check.log.