View Single Post
Old 15-01-2012, 15:39   #30
eaman
Senior Member
 
L'Avatar di eaman
 
Iscritto dal: Feb 2002
Messaggi: 2511
Semplificando l'uso di rsync potrebbe essere:
Codice:
rsync --progress --stats -ax
    --exclude=/robe_da escludere_a_priori
   /mnt/origine         <--- sarebbe l'originale da esaminare, la tua /
   /mnt/backup/root     <---- destinazione in cui sincronizzare
Il tuo hd-esterno lo monti su /mnt/backup
la partizione di root /dev/sda6 su /mn/origine
I mount sono tipo: mount /dev/sda6 /mnt/punto_di_mount



Ti posso lasciare degli script che uso sulle mie macchine se ti possono essere di spunto, sperando che non siano troppo "avanzati":

rsync_root ::
Codice:
#!/bin/sh
# This scripts initializes the root for incremental backups

/usr/bin/apt-get clean
mount -o remount,rw /mnt/backup/
rsync --progress --stats -ax --delete \
        --exclude=/tmp/ \
        --exclude=var/spool/squid3 \
        --exclude=mnt/clusters \
        --exclude=mnt/backup \
        --exclude=/proc \
        --exclude=/sys \
        --exclude=*vmdk \
        --exclude=*iso \
/ /mnt/backup/garage/root
mount -o remount,ro /mnt/backup/
rsync_root_fs_incremental :
Codice:
#!/bin/sh
# This script goes for the periodic incremental backup
# of the OS: root partition.
# Beware: garage is not build on LVM

FS_path=/mnt/backup
# Path where the backup filesystem is located:
# this could be used for a mount ro | rw

BAK_path=garage/os
# Relative path to FS_path where the actual backup is

/usr/bin/apt-get clean
mount -o remount,rw $FS_path
rsync --progress --stats -ax --delete \
        --link-dest=$FS_path/$BAK_path/latest \
        --exclude=/tmp/ \
        --exclude=var/spool/squid3 \
        --exclude=mnt/clusters \
        --exclude=mnt/backup \
        --exclude=/proc \
        --exclude=/sys \
        --exclude=*vmdk \
        --exclude=*iso \
/ $FS_path/$BAK_path/root_$(date +%Y%m%d)

rm $FS_path/$BAK_path/latest
ln -s $FS_path/$BAK_path/root_$(date +%Y%m%d) $FS_path/$BAK_path/latest

mount -o remount,ro $FS_path
- http://www.thegeekstuff.com/2010/09/...mand-examples/

Ultima modifica di eaman : 15-01-2012 alle 15:44.
eaman è offline   Rispondi citando il messaggio o parte di esso