aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/backup.sh17
-rwxr-xr-xscripts/bootstrap.sh (renamed from bootstrap.sh)0
2 files changed, 17 insertions, 0 deletions
diff --git a/scripts/backup.sh b/scripts/backup.sh
new file mode 100755
index 0000000..51ab218
--- /dev/null
+++ b/scripts/backup.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+OPT="-aPh"
+EXCLUDE="--exclude-from=$HOME/.backup-exclude-list.txt"
+LINK="--link-dest=/snapshots/$USER/latest"
+SRC="/home/$USER/"
+SNAP="/snapshots/$USER/"
+LATEST="/snapshots/$USER/latest"
+date=$(date "+%Y-%b-%d:_%T")
+
+[ ! -d $SNAP ] && mkdir -p $SNAP
+
+
+rsync $OPT $LINK $EXCLUDE $SRC ${SNAP}$date
+
+rm -f $LATEST
+ln -s ${SNAP}$date $LATEST
diff --git a/bootstrap.sh b/scripts/bootstrap.sh
index fdc8003..fdc8003 100755
--- a/bootstrap.sh
+++ b/scripts/bootstrap.sh