Skip to content

Instantly share code, notes, and snippets.

View benduncan's full-sized avatar
🧪
Chance only favours the mind which is prepared

Ben Duncan benduncan

🧪
Chance only favours the mind which is prepared
View GitHub Profile
@benduncan
benduncan / gist:c6fa0db5fdb8f615fa4f1d525d6b2bc7
Last active April 5, 2018 06:12
Mysql backup using PGP and Google storage via gsutil
#!/bin/sh
# Grab the date, captain!
DATE=`date`
# Dump all databases
mysqldump -u root --all-databases > /root/backup-sql/$DATE.sql
# Encrypt the backup based on a specified users PGP public key
gpg -e -r security@mydomain.com -a --trust-model always "/root/backup-sql/$DATE.sql"
### Keybase proof
I hereby claim:
* I am benduncan on github.
* I am benduncan (https://keybase.io/benduncan) on keybase.
* I have a public key ASDF2ZFYo5iqCyy97WO4iIHlB49tfdMm0lcM0l7DZYX3NAo
To claim this, I am signing this object: