summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2022-12-29 01:38:49 +0100
committerAndreas Fankhauser hiddenalpha.ch2022-12-29 01:38:49 +0100
commit26c678bd09379bcb97f6e92392a8052bb968df80 (patch)
treea40b57f0ec697a879c01a792514d58983b24818b
parente6c078d07ada15a9fa4315a6ee401c6e5d064f97 (diff)
downloadUnspecifiedGarbage-26c678bd09379bcb97f6e92392a8052bb968df80.zip
UnspecifiedGarbage-26c678bd09379bcb97f6e92392a8052bb968df80.tar.gz
(bkup-rsync) Include git-heads. Add more parents to dst.
-rwxr-xr-xsrc/main/shell/BackupByRsync/backup.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/shell/BackupByRsync/backup.sh b/src/main/shell/BackupByRsync/backup.sh
index 00f3a38..f934f1b 100755
--- a/src/main/shell/BackupByRsync/backup.sh
+++ b/src/main/shell/BackupByRsync/backup.sh
@@ -4,14 +4,16 @@
# Inspired by:
# https://linuxconfig.org/how-to-create-incremental-backups-using-rsync-on-linux
#
+# mount /dev/sdx1 /mnt/x
+#
set -o errexit
set -o pipefail
readonly NOW_SHORT="$(date -u '+%Y%m%d-%H%M%S')"
-readonly DIR_FROM="${HOME:?}/."
-readonly DIR_TO="/home/andreas/tmp/my-psydo-bkup"
-readonly BACKUP_PATH="${DIR_TO}/${NOW_SHORT}"
+readonly DIR_FROM="/home/${USER:?}/."
+readonly DIR_TO="/mnt/d/ssd512g/bkup-rsync/tux-six"
+readonly BACKUP_PATH="${DIR_TO}/${NOW_SHORT}/home/${USER:?}"
readonly LATEST_LINK="${DIR_TO}/latest"
@@ -49,6 +51,8 @@ run () {
--link-dest "${LATEST_LINK:?}" \
--filter=':- .gitignore' \
--exclude=".git" \
+ --include=".git/HEAD" \
+ --include=".git/refs/heads" \
--exclude=".idea" \
--exclude="/.NERDTreeBookmarks" \
--exclude="/.Xauthority" \