Created
July 23, 2017 09:40
-
-
Save weakish/ee07e083199eecf22d4746dfd7b216ea to your computer and use it in GitHub Desktop.
#encrypt a directory with #gnupg and #xz in #sh
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
#!/bin/sh | |
# Encrypt a directory with gnupg and xz. | |
# | |
# Usage: | |
# | |
# gpgxz dir | |
# | |
# This will tar the directory, compress it with xz, | |
# and sign and encrypt it with the current user's gnupg key. | |
# The output file will be `dir.txz.gpg` and we will list | |
# the contents of the output file. | |
# | |
# License: 0BSD | |
username="$(whoami)" | |
input_dir="$1" | |
output_file="$input_dir".txz.gpg | |
gpg-zip -r "$username" --tar-args cJ -o "$output_file" -s -e "$input_dir" && | |
gpg-zip --list-archive "$output_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment