#!/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 '{}'