Hands-on task
System cron: checking the site every 2 minutes
Write an executable script /usr/local/bin/site-up: it takes a URL as its first argument and, if the URL answered HTTP 200, prints UP and exits with code 0; otherwise it prints DOWN and exits with code 1. Then set up a system cron job as the file /etc/cron.d/site-up: as user root, every 2 minutes, check http://localhost:8070/ping, appending the output to /var/log/site-up.log. The cron daemon isn't running in the sandbox — start it yourself.
- cron.d
- system crontab
- curl http_code
- exit code
- */N