Iptables export
This commit is contained in:
parent
8334d82fdd
commit
365d638d06
2 changed files with 21 additions and 4 deletions
|
@ -6,9 +6,9 @@ Backup your Froxlor Webhosting (or anything else) to another server. Encrypted,
|
||||||
Works for all versions.
|
Works for all versions.
|
||||||
|
|
||||||
0. install duplicity and all required packages
|
0. install duplicity and all required packages
|
||||||
1. copy the script to the froxlorserver and run it as /$PATH/backup-server.sh full
|
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"
|
2. Add a cronjob like `17 2 * * * /$PATH/backup-server.sh`
|
||||||
3. Let the magic happen
|
3. Let the magic happen
|
||||||
|
|
||||||
You can restore your data with
|
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`
|
||||||
|
|
|
@ -34,6 +34,12 @@ BHOST='host.example.com'
|
||||||
mysql_user="root"
|
mysql_user="root"
|
||||||
mysql_password="P4aSsw04d"
|
mysql_password="P4aSsw04d"
|
||||||
|
|
||||||
|
# Backup iptables?
|
||||||
|
iptables=false
|
||||||
|
|
||||||
|
# Backup ip6tables?
|
||||||
|
ip6tables=false
|
||||||
|
|
||||||
# Temp Dir for SQL Backups (must exist)
|
# Temp Dir for SQL Backups (must exist)
|
||||||
temp="var/customers/temp_backup"
|
temp="var/customers/temp_backup"
|
||||||
|
|
||||||
|
@ -53,6 +59,9 @@ ALGO=AES
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
|
|
||||||
|
IPTABLESEXEC=`which iptables-save`
|
||||||
|
IP6TABLESEXEC=`which ip6tables-save`
|
||||||
|
|
||||||
### MySQL Export
|
### MySQL Export
|
||||||
# Date create
|
# Date create
|
||||||
datum=$(date +"%d"."%m"."%y")
|
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"
|
mysqldump -u $mysql_user -p$mysql_password $db > "$temp/$db.sql"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# export iptables and ip6tables
|
||||||
|
if [ $iptables = true ]; then
|
||||||
|
$IPTABLESEXEC > "$temp/iptables"
|
||||||
|
fi
|
||||||
|
if [ $ip6tables = true ]; then
|
||||||
|
$IP6TABLESEXEC > "$temp/ip6tables"
|
||||||
|
fi
|
||||||
|
|
||||||
### Backup
|
### Backup
|
||||||
|
|
||||||
if [ $ALGO ]; then
|
if [ $ALGO ]; then
|
||||||
|
|
Loading…
Reference in a new issue