Skip to content

Instantly share code, notes, and snippets.

@xZise
Created March 5, 2015 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xZise/22a482d1ff20a0f34050 to your computer and use it in GitHub Desktop.
Save xZise/22a482d1ff20a0f34050 to your computer and use it in GitHub Desktop.
owncloud backup
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