Skip to content

Instantly share code, notes, and snippets.

@maxaudron
maxaudron / backup.sh
Last active November 7, 2021 15:09
Make backups and clean up old ones using the grandfather-father-son principle
#!/bin/bash
# Make backups and clean up old ones using the grandfather-father-son principle
#
# Keeps one backup per four weeks ( roughly one per month ) for a year
# per week for four weeks
# per day for one week
#
# DRYRUN="yes" BACKUP_CONTEXT="/home/user" backup.sh BACKUP_SRC BACKUP_DEST
#
# DRYRUN: when set nothing is actually done, useful for testing