Debugging des SQL-Backups.

Anpassung von REAMDE
This commit is contained in:
Robin Kloppe 2014-03-12 18:59:14 +01:00
parent 0e83949cff
commit d984355a57
2 changed files with 15 additions and 12 deletions

View file

@ -4,3 +4,6 @@ Froxlorbackup
Backup your Froxlor Webhosting to another server. Encrypted, via ssh.
Works until version 0.9.32.
SQL works now also for Versions > 0.9.32.
HTML is planned to be backed up with duplicity

View file

@ -1,5 +1,5 @@
#!/bin/bash
# 2013 by Mainboarder.de
# 2014 by Mainboarder.de
#
# Keep this comment untouched and do not use this software for military purposes.
# you are allowed to use this just like you want on your own risk.
@ -7,13 +7,15 @@
# contains lines from http://menzerath.eu/artikel/froxlor-alle-datenbanken-und-verzeichnisse-sichern/
#
path="var/customers/backups/"
temp="var/customers/temp-backup-path/"
encryption="path/to/enc.key"
temp="var/customers/temp-backup-path"
backuppath="/mnt/usb/backups"
encryption="/path/to/enc.key"
external="user@extern.server.de"
MYSQL_USER="root"
MYSQL_PASSWORD="root"
# Programm
# um <<tar - Entferne führende „/“ von Elementnamen>> zu vermeiden
cd /
@ -29,17 +31,15 @@ for db in $databases; do
done
# Alle SQL-Dumps in ein Archiv packen
tar cfvz $temp/backup-sql-$datum.tar.gz $temp
tar cfvz $temp/../backup-sql-$datum.tar.gz $temp
#Verschlüsseln und gepackte Datei löschen
openssl aes-256-cbc -kfile $encryption -in backup-sql-$datum.tar.gz -out ./backup-sql-$datum.enc.tar.gz
openssl aes-256-cbc -kfile $encryption -in $temp/../backup-sql-$datum.tar.gz -out $temp/backup-sql-$datum.enc.tar.gz
rm backup-sql-$datum.tar.gz
rm $temp/../backup-sql-$datum.tar.gz
#Kopieren und verschlüsselte Datei löschen
scp -i /etc/ssh/ssh_host_dsa_key ./backup-sql-$datum.enc.tar.gz $external:/mnt/usb/backups
rm backup-sql-$datum.enc.tar.gz
scp -i /etc/ssh/ssh_host_dsa_key $temp/backup-sql-$datum.enc.tar.gz $external:$backuppath
rm -r $temp
mkdir $temp