Iptables export

This commit is contained in:
Robin Kloppe 2015-03-06 08:56:53 +01:00
parent 8334d82fdd
commit 365d638d06
2 changed files with 21 additions and 4 deletions

View file

@ -6,9 +6,9 @@ Backup your Froxlor Webhosting (or anything else) to another server. Encrypted,
Works for all versions.
0. install duplicity and all required packages
1. copy the script to the froxlorserver and run it as /$PATH/backup-server.sh full
2. Add a cronjob like "17 2 * * * /$PATH/backup-server.sh"
1. copy the script to the froxlorserver and run it as `/$PATH/backup-server.sh full`
2. Add a cronjob like `17 2 * * * /$PATH/backup-server.sh`
3. Let the magic happen
You can restore your data with
duplicity --file-to-restore neddedFile $EXTERNALPATH/TO//media/mount/duplicity/path/to/file/ /where/to/save/now
`duplicity --file-to-restore neddedFile $EXTERNALPATH/TO//media/mount/duplicity/path/to/file/ /where/to/save/now`

View file

@ -34,6 +34,12 @@ BHOST='host.example.com'
mysql_user="root"
mysql_password="P4aSsw04d"
# Backup iptables?
iptables=false
# Backup ip6tables?
ip6tables=false
# Temp Dir for SQL Backups (must exist)
temp="var/customers/temp_backup"
@ -53,6 +59,9 @@ ALGO=AES
##############################
IPTABLESEXEC=`which iptables-save`
IP6TABLESEXEC=`which ip6tables-save`
### MySQL Export
# Date create
datum=$(date +"%d"."%m"."%y")
@ -67,6 +76,14 @@ for db in $databases; do
mysqldump -u $mysql_user -p$mysql_password $db > "$temp/$db.sql"
done
# export iptables and ip6tables
if [ $iptables = true ]; then
$IPTABLESEXEC > "$temp/iptables"
fi
if [ $ip6tables = true ]; then
$IP6TABLESEXEC > "$temp/ip6tables"
fi
### Backup
if [ $ALGO ]; then