monthly.local 460 B

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