I'm writing a script which creates project archives and then creates 7z archives of them to make it easier on me to save specific versions and keep encrypted backups.
After I've generated the archives and I get to the encryption phase, I'd like to encrypt the files with one call to gpg
if possible, so as to only have the user input their passphrase once. Otherwise, we'd either have to cache the user's passphrase in memory (which I'd really like not to do) or have them input and confirm their passphrase for every single project that is archived (which is worse).
Is there a way to pass multiple filenames to gpg
to have it encrypt all of them in one go?
If I try this:
$ gpg --cipher-algo AES256 --compression-algo BZIP2 -c project1.7z project2.7z
...I see the following error in the shell:
usage: gpg [options] --symmetric [filename]
Is there a way to do what I'm looking to accomplish?
Is there a way to pass multiple filenames to gpg to have it encrypt all of them in one go? Yes, try this answer
– Anchan Feb 18 '16 at 12:35