duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] decryption failure in duplicity replicate


From: Jeffrey Walton
Subject: Re: [Duplicity-talk] decryption failure in duplicity replicate
Date: Wed, 25 Aug 2021 04:51:49 -0400

On Tue, Aug 24, 2021 at 3:35 AM zga9uhnq4g--- via Duplicity-talk
<duplicity-talk@nongnu.org> wrote:
>
> Thanks for suggestions Edgar.
>
> I get the same error "gpg: decryption failed: Bad session key" when trying 
> verify/restore my backup from 2020-12-12.
>
> Following the info in the link you mentioned, I tried manually decrypting via 
> gpg.  I found that I could decrypt all the incremental backups in the chain 
> (at least all the ones I tried), but decrypting the original full backup 
> failed with  "gpg: decryption failed: Bad session key".  Thinking back, I 
> think I know what happened.  That first full backup was executed 
> interactively from the command-line, and I got prompted for the passphrase as 
> copy/pasted it in.  All the backup after that were executed from my backup 
> script (that I schedule to run at 3:30, and there I use the PASSPHRASE 
> environment variable.  I was even able to confirm that (sort of) by looking 
> in my .bash_history file.  I had just about resigned myself to the fact that 
> the first backup chain was useless, but I just came back after a couple 
> hours, had an idea, and figured out the passphrase for that original full 
> backup.  As is common, my passphrase is words separated by spaces (e.g. the 
> quick brown dog jumps), so when I set PASSPHRASE (for some reason I don't 
> remember) I used backslashes to escape the spaces (e.g. PASSPHRASE=the\ 
> quick\ brown\ dog\ jumps).  I discovered that when I run "gpg ... -decrypt 
> ..." and when it prompts for the passphrase I type the passprhase with the 
> backslashes it successfully decrypts.

This may be helpful to use in your script. I use it to trigger a full
backup every three months to help keep backup sets manageable. I think
it would have helped you since you would have a full backup to use
from July 1.

day=$(date +%d)
if [ "${day}" = "01" ];
then
    month=$(date +%m)
    case ${month} in
        01|04|07|10)
          full_backup=full
          ;;
        *)
          ;;
    esac
fi

...

if ! duplicity ${full_backup} <other params ...> ;
then
    echo "Failed to backup"
    exit 1
fi

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]