diff options
-rw-r--r-- | scripts/backup-directory | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/backup-directory b/scripts/backup-directory new file mode 100644 index 0000000..2b754f0 --- /dev/null +++ b/scripts/backup-directory @@ -0,0 +1,11 @@ +#!/bin/sh + +# Backup a directory using GPG. +# Usage: backup-directory directory-name + +DIRECTORY="$1" + +7z a "$DIRECTORY.7z" "$DIRECTORY" +gpg --encrypt --armor --symmetric --output "$DIRECTORY.7z.asc" "$DIRECTORY.7z" +sha256sum "$DIRECTORY.7z.asc" | cut -c1-64 > "$DIRECTORY.asc.sum" + |