Created
July 16, 2017 21:52
-
-
Save punksta/8688f684f1266197d55472be774e437b to your computer and use it in GitHub Desktop.
Create gpg encrypted tag.gz arhive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keyId="email or key id" | |
#prefix of output file | |
prefix="mybackup" | |
#current date current time | |
now=`date +"%m_%d_%Y_%T"` | |
path=$1 | |
outputDir=$2 | |
tarFile="$outputDir/${prefix}_${now}.tar.gz" | |
gpgOutPut="$tarFile.gpg" | |
tar -czf $tarFile $path | |
gpg2 --encrypt --output $gpgOutPut -r "$keyId" "$tarFile" | |
rm $tarFile | |
echo "$gpgOutPut created" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment