Merge branch 'master' into debian
This commit is contained in:
commit
bf01adb0fd
|
@ -81,7 +81,7 @@ You can save various systems on evobackup jail : Linux, BSD, Windows, MacOSX. O
|
||||||
rsync -av -e "ssh -p SSH_PORT" /home/ root@SERVER_NAME:/var/backup/home/
|
rsync -av -e "ssh -p SSH_PORT" /home/ root@SERVER_NAME:/var/backup/home/
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
An example script is present in docs/zzz_evobackup, clone evobackup repo and read **CLIENT CONFIGURATION** section of the manual.
|
An example script is present in zzz_evobackup, clone evobackup repo and read **CLIENT CONFIGURATION** section of the manual.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
git clone https://forge.evolix.org/evobackup.git
|
git clone https://forge.evolix.org/evobackup.git
|
||||||
|
|
|
@ -218,7 +218,7 @@ You can save various systems on evobackup jail : Linux, BSD, Windows, MacOSX. O
|
||||||
rsync -av -e "ssh -p SSH_PORT" /home/ root@SERVER_NAME:/var/backup/home/
|
rsync -av -e "ssh -p SSH_PORT" /home/ root@SERVER_NAME:/var/backup/home/
|
||||||
.PP
|
.PP
|
||||||
.RE
|
.RE
|
||||||
You can simply create a shell script which use rsync for backup your's servers. An example script is available in docs/zzz_evobackup for quickstart.
|
You can simply create a shell script which use rsync for backup your's servers. An example script is available in zzz_evobackup for quickstart.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
This documentation explain how to use this example script.
|
This documentation explain how to use this example script.
|
||||||
|
|
|
@ -33,14 +33,14 @@ trap "rm -f $PIDFILE" EXIT
|
||||||
# port SSH
|
# port SSH
|
||||||
SSH_PORT=2XXX
|
SSH_PORT=2XXX
|
||||||
|
|
||||||
# choose "linux" or "bsd"
|
|
||||||
SYSTEM=$(uname | tr '[:upper:]' '[:lower:]')
|
|
||||||
|
|
||||||
# email adress for notifications
|
# email adress for notifications
|
||||||
MAIL=jdoe@example.com
|
MAIL=jdoe@example.com
|
||||||
|
|
||||||
|
# choose "linux" or "bsd"
|
||||||
|
SYSTEM=$(uname | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
# Variable to choose different backup server with date
|
# Variable to choose different backup server with date
|
||||||
NODE=$(($(date +%d) % 2))
|
NODE=$(($(date +%e) % 2))
|
||||||
|
|
||||||
# serveur address for rsync
|
# serveur address for rsync
|
||||||
SRV="node$NODE.backup.example.com"
|
SRV="node$NODE.backup.example.com"
|
||||||
|
@ -82,11 +82,9 @@ mkdir -p -m 700 /home/backup
|
||||||
# mysqlhotcopy BASE /home/mysqlhotcopy/
|
# mysqlhotcopy BASE /home/mysqlhotcopy/
|
||||||
|
|
||||||
## example for multiples MySQL instances
|
## example for multiples MySQL instances
|
||||||
# mysqladminpasswd=`cat /root/.my.cnf |grep -m1 'password = .*' |cut -d" " -f3`
|
# mysqladminpasswd=$(grep -m1 'password = .*' /root/.my.cnf|cut -d" " -f3)
|
||||||
# grep -E "^port\s*=\s*\d*" /etc/mysql/my.cnf |while read instance; do
|
# grep -E "^port\s*=\s*\d*" /etc/mysql/my.cnf |while read instance; do
|
||||||
# instance=$(echo $instance |tr -d '\t')
|
# instance=$(echo "$instance"|awk '{ print $3 }')
|
||||||
# instance=${instance// /}
|
|
||||||
# instance=${instance//port=/}
|
|
||||||
# if [ "$instance" != "3306" ]
|
# if [ "$instance" != "3306" ]
|
||||||
# then
|
# then
|
||||||
# mysqldump -P $instance --opt --all-databases --hex-blob -u mysqladmin -p$mysqladminpasswd > /home/backup/mysql.$instance.bak
|
# mysqldump -P $instance --opt --all-databases --hex-blob -u mysqladmin -p$mysqladminpasswd > /home/backup/mysql.$instance.bak
|
||||||
|
@ -101,7 +99,7 @@ mkdir -p -m 700 /home/backup
|
||||||
## another method with gzip directly piped
|
## another method with gzip directly piped
|
||||||
# cd /var/lib/postgresql
|
# cd /var/lib/postgresql
|
||||||
# sudo -u postgres pg_dumpall | gzip > /home/backup/pg.dump.bak.gz
|
# sudo -u postgres pg_dumpall | gzip > /home/backup/pg.dump.bak.gz
|
||||||
# cd -
|
# cd - > /dev/null
|
||||||
|
|
||||||
## example with all tables from MYBASE excepts TABLE1 and TABLE2
|
## example with all tables from MYBASE excepts TABLE1 and TABLE2
|
||||||
# pg_dump -p 5432 -h 127.0.0.1 -U USER --clean -F t --inserts -f /home/backup/pg-backup.tar -t 'TABLE1' -t 'TABLE2' MYBASE
|
# pg_dump -p 5432 -h 127.0.0.1 -U USER --clean -F t --inserts -f /home/backup/pg-backup.tar -t 'TABLE1' -t 'TABLE2' MYBASE
|
||||||
|
@ -140,7 +138,7 @@ mkdir -p -m 700 /home/backup
|
||||||
|
|
||||||
## Dump MBR / table partitions with dd and sfdisk
|
## Dump MBR / table partitions with dd and sfdisk
|
||||||
## Linux
|
## Linux
|
||||||
#for disk in $(ls /dev/{s,v}d[a-z] 2>/dev/null); do
|
#for disk in $(ls /dev/[sv]d[a-z] 2>/dev/null); do
|
||||||
# name=$(basename $disk)
|
# name=$(basename $disk)
|
||||||
# dd if=$disk of=/home/backup/MBR-$name bs=512 count=1 2>&1 | egrep -v "(records in|records out|512 bytes)"
|
# dd if=$disk of=/home/backup/MBR-$name bs=512 count=1 2>&1 | egrep -v "(records in|records out|512 bytes)"
|
||||||
# fdisk -l $disk > /home/backup/partitions-$name
|
# fdisk -l $disk > /home/backup/partitions-$name
|
||||||
|
@ -186,7 +184,7 @@ BEGINNING=$(/bin/date +"%d-%m-%Y ; %H:%M")
|
||||||
if [ "$SYSTEM" = "linux" ]; then
|
if [ "$SYSTEM" = "linux" ]; then
|
||||||
rep="/bin /boot /lib /opt /sbin /usr"
|
rep="/bin /boot /lib /opt /sbin /usr"
|
||||||
else
|
else
|
||||||
rep="/bsd /bin /boot /sbin /usr"
|
rep="/bsd /bin /sbin /usr"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rsync -avzh --stats --delete --delete-excluded --force --ignore-errors --partial \
|
rsync -avzh --stats --delete --delete-excluded --force --ignore-errors --partial \
|
||||||
|
@ -218,6 +216,7 @@ rsync -avzh --stats --delete --delete-excluded --force --ignore-errors --partial
|
||||||
--exclude "/var/lib/amavis/tmp" \
|
--exclude "/var/lib/amavis/tmp" \
|
||||||
--exclude "/var/lib/clamav/*.tmp" \
|
--exclude "/var/lib/clamav/*.tmp" \
|
||||||
--exclude "/home/mysqltmp" \
|
--exclude "/home/mysqltmp" \
|
||||||
|
--exclude "/var/lib/php/sessions" \
|
||||||
$rep \
|
$rep \
|
||||||
/etc \
|
/etc \
|
||||||
/root \
|
/root \
|
Loading…
Reference in a new issue