Backup-Scripts/btrfs/retention-gc

10 lines
224 B
Plaintext
Raw Permalink Normal View History

2024-11-30 11:08:38 +00:00
#!/bin/sh
#
# BTRFS retention script
# CC0 ~caskd
: ${SNAPDIR:?'Snapdir not defined'}
: ${RETENTION_DAYS:=7}
find "$SNAPDIR" -mindepth 1 -maxdepth 1 -type d -mtime +"$RETENTION_DAYS" | parallel btrfs subvolume delete '{}'