Skip to content

Instantly share code, notes, and snippets.

@mgax
Created October 12, 2017 14:34
Show Gist options
  • Save mgax/0dcf3f6c97e3de07e20d66bd1bb7c9f9 to your computer and use it in GitHub Desktop.
Save mgax/0dcf3f6c97e3de07e20d66bd1bb7c9f9 to your computer and use it in GitHub Desktop.
streamed encrypted backups
#!/bin/bash
set -e
TIME=$(date +%Y-%m-%dT%H:%M:%S)
source key.sh # script care face `export BACKUP_KEY='random plm'
set -x
ssh fraier tar czh -C /mnt/ceva altceva \
| pv \
| openssl aes-256-cbc -pass env:BACKUP_KEY \
> path/to/backup-$TIME.tgz.enc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment