Skip to content

Commit

Permalink
Checking disk usage in backup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alsmk committed Jan 7, 2025
1 parent 8501170 commit 689f3c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions infrastructure/backups/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,9 @@ rm /tmp/${LABEL:-$BACKUP_DATE}.tar.gz.enc
rm /tmp/${LABEL:-$BACKUP_DATE}.tar.gz
rm -r $BACKUP_RAW_FILES_DIR

#Checking the disk usage of backup server

DISK_USAGE=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//g')
if (( DISK_USAGE > 80 )); then
echo "$(date): Disk usage is at ${DISK_USAGE}% on the root partition. Threshold exceeded!" >&2
fi

0 comments on commit 689f3c8

Please sign in to comment.