Hands-on task
Write a healthcheck
Write an executable script /usr/local/bin/healthcheck that takes a URL as an argument, exits with code 0 if the URL responds with HTTP 200, and 1 otherwise. Then set up a cron job (in any user's crontab or as a file in /etc/cron.d/) that runs it against http://localhost:5000/health every minute, appending its output to /var/log/healthcheck.log. The cron daemon isn't running in the sandbox — start it yourself.
- curl http_code
- exit code
- cron
- crontab
- append >>