Remote encrypted backup using gpg and s3

After 10 years with, time has come to move to a different secure remote storage.

The shell script to encrypt and upload gets a refresh as well, and syncs to Amazon S3 (not exactly a secure storage btw).

#! /bin/bash

GPG_DEST="[email protected]"

echo "Start encryption..."

find . -iname '*[pdf|xls|csv]' -exec echo '{}' \; | while read f

    if [ -f "$f" ] && [ ! -f "$f".gpg ]; then

        gpg -e -r $GPG_DEST "$f"

        touch -r "$f" "$f".gpg



echo "Start upload..."

aws s3 sync --exclude "*" --include "*.gpg" $DOC_ROOT s3://$AWS_BUCKET

echo "Finished."

Edit: I will stay with The guys are cool and we both agreed to review the terms and conditions, but more than this, their service is still awesome.

Leave a Reply

Your email address will not be published. Required fields are marked *