From 0644d7679c960b38420809556bd858b9ea0ab26d Mon Sep 17 00:00:00 2001 From: bayareamarketing Date: Wed, 24 Jun 2015 13:33:06 +0200 Subject: [PATCH] Make tar stdin/stdout explicit in backup function Fixes (show stopper) error on FreeBSD, potentially other platforms: $ gpg -d duplicity-backup-2015-xx-xx.tar.gpg | tar x tar: Error opening archive: Failed to open '/dev/sa0' (tar does not r/w to stdin/out by default, you have to specify) --- duplicity-backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 5dcae5e..4fc04ce 100644 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -656,11 +656,11 @@ backup_this_script() echo -e ${README_TXT} > ${README} echo "Encrypting tarball, choose a password you'll remember..." - tar c ${TMPDIR} | gpg -aco ${TMPFILENAME} + tar -cf - ${TMPDIR} | gpg -aco ${TMPFILENAME} rm -Rf ${TMPDIR} echo -e "\nIMPORTANT!!" echo ">> To restore these files, run the following (remember your password):" - echo "gpg -d ${TMPFILENAME} | tar x" + echo "gpg -d ${TMPFILENAME} | tar -xf -" echo -e "\nYou may want to write the above down and save it with the file." }