From a2df71d6e8ef34087db04057d628bad9b8b50681 Mon Sep 17 00:00:00 2001 From: Tod Fitch Date: Tue, 15 Sep 2020 08:51:59 -0700 Subject: [PATCH] Revert backslashes Signed-off-by: Tod Fitch --- .../README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/how-to-backup-and-encrypt-data-privately-and-securely-using-rsync-and-veracrypt-on-macos/README.md b/how-to-backup-and-encrypt-data-privately-and-securely-using-rsync-and-veracrypt-on-macos/README.md index 3d8a30b..51d5b10 100644 --- a/how-to-backup-and-encrypt-data-privately-and-securely-using-rsync-and-veracrypt-on-macos/README.md +++ b/how-to-backup-and-encrypt-data-privately-and-securely-using-rsync-and-veracrypt-on-macos/README.md @@ -208,7 +208,7 @@ function cleanup() trap cleanup ERR INT -veracrypt --text --mount --pim 0 --keyfiles "" --protect-hidden no "${BACKUP_VOLUME_PATH}" /Volumes/Backup +veracrypt --text --mount --pim 0 --keyfiles "" --protect-hidden no "$BACKUP_VOLUME_PATH" /Volumes/Backup mkdir -p /Volumes/Backup/Versioning @@ -218,16 +218,14 @@ declare -a files=( "/Users/$(whoami)/Library/Keychains" ) -timestamp=$(date +'.%F_%H-%M') - -for file in "${files[@]}"; do - rsync -axRS --delete --backup --backup-dir /Volumes/Backup/Versioning --suffix="${timestamp}" "${file}" /Volumes/Backup +for file in "\${files[@]}"; do + rsync -axRS --delete --backup --backup-dir /Volumes/Backup/Versioning --suffix=\$(date +'.%F_%H-%M') "\$file" /Volumes/Backup done -if [ "$(find /Volumes/Backup/Versioning -type f -ctime +90)" != "" ]; then +if [ "\$(find /Volumes/Backup/Versioning -type f -ctime +90)" != "" ]; then printf "Do you wish to prune versions older than 90 days (y or n)? " read -r answer - if [ "${answer}" = "y" ]; then + if [ "\$answer" = "y" ]; then find /Volumes/Backup/Versioning -type f -ctime +90 -delete find /Volumes/Backup/Versioning -type d -empty -delete fi @@ -243,7 +241,7 @@ veracrypt --text --dismount "$BACKUP_VOLUME_PATH" printf "Generate hash (y or n)? " read -r answer -if [ "${answer}" = "y" ]; then +if [ "\$answer" = "y" ]; then openssl dgst -sha512 "$BACKUP_VOLUME_PATH" fi