From 7092f85cc40f133e8ede8796d43006421a428fdc Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 10 Dec 2021 00:23:17 +0800 Subject: Auto clean old backup file --- scripts/backup.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/backup.sh b/scripts/backup.sh index 51ab218..eca16da 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Delete old snapshots +find "/snapshots/$USER" -maxdepth 1 -mtime +120 -type d -execdir rm -rf {} + + OPT="-aPh" EXCLUDE="--exclude-from=$HOME/.backup-exclude-list.txt" LINK="--link-dest=/snapshots/$USER/latest" -- cgit v1.2.3