rsync or replacement backup

Karl Larsen k5di at zianet.com
Mon May 19 21:15:21 UTC 2008


Mike Bird wrote:
> On Mon May 19 2008 12:58:01 Karl Larsen wrote:
>   
>> karl at karl-desktop:~$ cat /root/bin/backup
>> # This file is designed to backup my Ubuntu to the USB Hard Drive using
>> rsync
>> # Karl Larsen, 26 Feb 08
>> rsync -avz /boot /media/disk/
>>     
>
> Omit the "-z".  It compresses traffic over networks but it
> doesn't help with local copies.
>
>   
>> rsync -avz /bin  /media/disk/
>> rsync -avz /dev  /media/disk/
>>     
>
> You probably don't want to ever restore /dev, so backing it up
> could be regarded as a waste of time.  However it's small and
> the information from a /dev backup is sometimes useful in
> emergencies so go ahead and back it up.
>
>   
>> rsync -avz /etc  /media/disk/
>> rsync -avz /lib  /media/disk/
>> rsync -avz /opt  /media/disk/
>> rsync -avz /root /media/disk/
>> rsync -avz /sbin /media/disk/
>> rsync -avz /srv  /media/disk/
>> rsync -avz /sys  /media/disk/
>>     
>
> /sys is a special filesystem like /proc.  I wouldn't back it up.
>
>   
>> rsync -avz /tmp /media/disk/
>>     
>
> Most people don't backup /tmp, /var/tmp, ... to save time and space.
>
>   
>> rsync -avz /usr /media/disk/
>> rsync -avz /var /media/disk/
>> rsync -avz /initrd /media/disk/
>>
>>     Of course /sbin is the current sbin directory. /media/disk/ is where
>> the USB hard disk is located.
>>
>>      So does anyone know a good one line way to do the same thing?
>>     
>
> Here's a one-liner.  You might want to adjust the exclusions
> to suit your needs.  Make sure the correct disk is mounted on
> /media/disk before starting.  [With rsync v3 you can add "-X" :-) ]
>
> rsync -va -SHA --partial --delete --delete-excluded --exclude=/media --exclude=/proc --exclude=/sys --exclude=/tmp --exclude=/var/spool/squid --exclude=/var/tmp --exclude=/mnt --exclude='/home/*/.mozilla/firefox/*/Cache' / /media/disk/
>
> --Mike Bird
>
>   
    Hi Mike I like yours better than mine. I hear all your do not do and 
am going to try the --exclude= thing because it makes sense, if it 
works. I'm using this now:

sudo rsync -avz /root /boot ... /usr : /mnt

and it seems to be working. It does complain about not being able to 
forward some files.

Karl


-- 

	Karl F. Larsen, AKA K5DI
	Linux User
	#450462   http://counter.li.org.
   PGP 4208 4D6E 595F 22B9 FF1C  ECB6 4A3C 2C54 FE23 53A7





More information about the ubuntu-users mailing list