I Replaced My 47-Line Bash Monitoring Script with One curl Command
Every DevOps engineer has that bash script. The one monitoring cron jobs. The one nobody wants to touch. Here was mine: #!/bin/bash # cron_monitor.sh - "temporary" script from 2019 LOCK_FILE = "/tmp/backup_monitor.lock" LOG_FILE = "/var/log/cron_monitor.log" LAST_RUN_FILE = "/tmp/last_backup_run" SLACK_WEBHOOK = "https://hooks.slack.com/services/T.../B.../xxx" MAX_AGE = 7200 # 2 hours if [ -f " $LOCK_FILE " ] ; then echo " $( date ) Lock file exists, skipping" >> $LOG_FILE exit 0 fi touch " $LOC
Comment
Sign in to join the discussion.
Loading comments…