aboutsummaryrefslogtreecommitdiff
path: root/scripts/backup.sh
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-12-10 00:23:17 +0800
committerGuangxiong Lin <[email protected]>2021-12-10 00:23:17 +0800
commit7092f85cc40f133e8ede8796d43006421a428fdc (patch)
tree2b894434c93201042c06403fe6852c975cad4be5 /scripts/backup.sh
parent3ea6f27772ef1eec6219b2141455112a398e129d (diff)
downloaddotfiles-7092f85cc40f133e8ede8796d43006421a428fdc.tar.gz
dotfiles-7092f85cc40f133e8ede8796d43006421a428fdc.tar.bz2
dotfiles-7092f85cc40f133e8ede8796d43006421a428fdc.zip
Auto clean old backup file
Diffstat (limited to 'scripts/backup.sh')
-rwxr-xr-xscripts/backup.sh3
1 files changed, 3 insertions, 0 deletions
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"