Created
March 5, 2015 20:26
-
-
Save xZise/22a482d1ff20a0f34050 to your computer and use it in GitHub Desktop.
owncloud backup
This file contains 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
now=`date +"%Y%m%d"` | |
sudo tar -cf ./owncloud-$now.tar /var/www/owncloud/ | |
sudo chown fabian:fabian ./owncloud-$now.tar | |
echo 'PostgreSQL password coming up...' | |
pg_dump owncloud -h localhost -U postgres -f owncloud-sqlbkp_$now.bak | |
tar -rf ./owncloud-$now.tar owncloud-sqlbkp_$now.bak | |
echo 'Compressing...' | |
xz owncloud-$now.tar | |
echo 'Encrypting...' | |
openssl aes-256-cbc -salt -in owncloud-$now.tar.xz -out owncloud-$now.tar.xz.aes | |
du owncloud-$now.tar.xz.aes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment