Tarsnap Manager is a Python script to manage backups of data using Tarsnap, and is intended to be run as a daily cron job. The directories to backup and the number of daily, weekly, and monthly backups to keep are configured by the command line:
- If
num_daysdaily backups already exist when a new one is created, the oldest daily backup is removed. - Weekly backups happen on every weekday specified by
weekday. Ifnum_weeksweekly backups already exist when a new one is created, the oldest weekly backup is removed. - Likewise, monthly backups happen on the first weekday of the month specified by
weekday. Ifnum_monthsmonthly backups already exist when a new one is created, the oldest monthly backup is removed.
key_file: The path to the file containing encryption, authentication, and access keys, generated bytarsnap-keygen. This is passed totarsnapas--keyfile.cache_dir: The directory that caches information about the stored archives. This is passed totarsnapas--cachedir.dry_run: Iftrue, then no archives are created or deleted. Instead, thetarsnapcommands that would have been run are simply printed.skip_delete: Skips deleting the oldest daily, weekly, or monthy archive. Use if the specified key file was created bytarsnap-keymgmtto not allow deletion.archive_name: The prefix for each archive name.weekday: The day on which to perform weekly and monthly backups, where Monday is1and Sunday is7.num_days: The number of consecutive daily backups to store. The oldest daily backup is deleted if necessary, unlessskip_deleteis specified.num_weeks: The number of consecutive weekly backups to store. The oldest weekly backup is deleted if necessary, unlessskip_deleteis specified.num_months: The number of consecutive monthly backups to store. The oldest monthly backup is deleted if necessary, unlessskip_deleteis specified.