linux - How to tgz all items in a directory and encrypt it using GnuPG on the fly? -


I am searching for all the items in a directory to solve tgz and at that stage I want to encrypt it on GnuPG Am fly

I use all the items in the directory for the TGG

  i *; Tar CFVs $ i.tgz $ i; Done  

I think I have to pip it like gpg

  | Gpg -z 0 - Different-trust - encryc -r mail@mail.com & gt; "File" .tgz.gpg  

but do I have to call gpg ? Everything that I tried happened in an error.

If you are fine in storing the intermediate file hard disk, just encrypt it (and possibly Remove it later). As a result the script will look something like

 for  i in * * tar cfvz $ i.tgz $ i gpg -r mail@mail.com --encrypt $ i.tgz # Include other options If you want to do the operation without an intermediate unencrypted file on the disk, make sure the tar file is in stdout instead of the required rm $ i.tgz # if you want to  

Dumping is to write it in the file (without using the -f flag):

  i in *; Tar cvij $ i | Gpg -r mail@mail.com - encryption & gt; $ I.tgz.gpg; Done  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -