Differenze tra le versioni 1 e 3 (in 2 versioni)
Dimensione: 1014
Commento:
|
← Versione 3 del 2009-03-17 00:52:24 ⇥
Dimensione: 1429
Commento:
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 4: | Linea 4: |
Appunti: | |
Linea 8: | Linea 7: |
lvcreate -L20G -s -n test2 /dev/jenna/briana mount /dev/jenna/test2 /mnt/test2 #tar -jcpvf /sip_tar/sip_snapshot`date +%Y%m%d`.tar.bz2 /sip_backup #umount /sip_backup/ #lvremove /dev/secondo/sip_snapshot |
LVNAME=ale #logica volume name VGNAME=birra #virtual group name HOST=www.myhost-I-want-to-backup.org #name of the host machine to backup BACKUP_HOST=backup.machine.it #name of the machine where we want to upload the backup BACKUP_USER=lorenzo BACKUP_DIR=/home/lorenzo/ale #backup dir where we put tar.gz files DIRS="home var" #dirs to backup MYSQLPASS=mypass #--------------------------------------------------# mkdir -p /backup ssh root@$HOST "mkdir -p /root/backup/; mysqldump -p$MYSQLPASS --all-databases | bzip2 -c > /root/backup/norimberga-alldb-`date -I`.sql.bz2" # svn, hg backup here |
Linea 15: | Linea 24: |
svnadmin -q dump /var/svn/ninuxdeveloping | bzip2 -c > ninuxdeveloping`date -I`.dump.bz2 mysqldump -pmysqlpassword --all-databases | bzip2 -c > AMD64-norimberga`date -I`.sql.bz2 cd /var tar -jcf /root/backup/www`date -I`.tar.bz2 www cd /var/lib/ tar -jcf /root/backup/trac`date -I`.tar.bz2 trac ssh saverio@backup.server.it "mv /home/saverio/norimbergabackup/*.bz2 /home/saverio/norimbergabackup/temp/" scp /root/backup/* saverio@backup.server.it:/home/saverio/norimbergabackup/ ssh saverio@backup.netgroup.uniroma2.it "rm /home/saverio/norimbergabackup/temp/*" echo Backup Norimberga `date -I` tutto OK |
# create a snapshot lvcreate -L20G -s -n $LVNAME\_snap /dev/$VGNAME/$LVNAME mkdir -p /mnt/$LVNAME\_backup mkdir -p /backup/$LVNAME mount /dev/$VGNAME/$LVNAME\_snap /mnt/$LVNAME\_backup # we use a rsync friendly gzip # more details to http://svana.org/kleptog/rgzip.html cd /mnt/$LVNAME\_backup tar c --use-compress-program /usr/local/bin/rgzip -vf /backup/$LVNAME/$LVNAME`date -I`.tar.gz2 $DIRS #rsync with the backup machine rsync -avz -e ssh /backup/$LVNAME/$LVNAME`date -I`.tar.gz2 $BACKUP_USER@$BACKUP_HOST:$BACKUP_DIR #umount and destroy snapshot umount /mnt/$LVNAME\_backup lvremove /dev/$VGNAME/$LVNAME\_snap |
Script per backuppare una macchina xen, comprimere le cartelle "importanti" e mandarle in rsync "furbo" su una macchina remota.
LVNAME=ale #logica volume name VGNAME=birra #virtual group name HOST=www.myhost-I-want-to-backup.org #name of the host machine to backup BACKUP_HOST=backup.machine.it #name of the machine where we want to upload the backup BACKUP_USER=lorenzo BACKUP_DIR=/home/lorenzo/ale #backup dir where we put tar.gz files DIRS="home var" #dirs to backup MYSQLPASS=mypass #--------------------------------------------------# mkdir -p /backup ssh root@$HOST "mkdir -p /root/backup/; mysqldump -p$MYSQLPASS --all-databases | bzip2 -c > /root/backup/norimberga-alldb-`date -I`.sql.bz2" # svn, hg backup here # create a snapshot lvcreate -L20G -s -n $LVNAME\_snap /dev/$VGNAME/$LVNAME mkdir -p /mnt/$LVNAME\_backup mkdir -p /backup/$LVNAME mount /dev/$VGNAME/$LVNAME\_snap /mnt/$LVNAME\_backup # we use a rsync friendly gzip # more details to http://svana.org/kleptog/rgzip.html cd /mnt/$LVNAME\_backup tar c --use-compress-program /usr/local/bin/rgzip -vf /backup/$LVNAME/$LVNAME`date -I`.tar.gz2 $DIRS #rsync with the backup machine rsync -avz -e ssh /backup/$LVNAME/$LVNAME`date -I`.tar.gz2 $BACKUP_USER@$BACKUP_HOST:$BACKUP_DIR #umount and destroy snapshot umount /mnt/$LVNAME\_backup lvremove /dev/$VGNAME/$LVNAME\_snap