Created
August 13, 2024 01:16
-
-
Save demacdolincoln/1a9b1948bc8abc26fad3739579098a3d to your computer and use it in GitHub Desktop.
backup-gpg.sh
This file contains hidden or 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
#!/usr/bin/sh -x | |
gpg --export-secret-keys --export-options backup --output secret_keys.gpg | |
gpg --export --export-options backup --output public_keys.gpg | |
XZ_OPT=-e9 tar --xz -cf gpg_keys.tar.xz secret_keys.gpg public_keys.gpg | |
rage -e -p gpg_keys.tar.xz > gpg_keys.tar.xz.age | |
rm secret_keys.gpg | |
rm public_keys.gpg | |
rm gpg_keys.tar.xz | |
# instruções para restaurar o backup: | |
# | |
# age -d gpg_keys.tar.xz.age | tar --xz -xf - | |
# gpg --import secret_keys.gpg | |
# gpg --import public_keys.gpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment