#! /bin/sh # This script will rely on two other scripts: # remove_nonfullbackups.sh # compact_backups.sh HOME=/root/ LAST_MONTH=$(date -j -r $(($(date +%s) - (60*60*24*$(date +%e)))) +%Y-%m) # TODO: Check if we have a valid level 0 backup for this month echo "Removing non level 0 backups from ${LAST_MONTH}" echo /root/bin/remove_nonfullbackups.sh ${LAST_MONTH} echo "Compacting backups from ${LAST_MONTH}" echo /root/bin/compact_backups.sh ${LAST_MONTH}