Questions about rsync

Daniel Armstrong dwarmstrong-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Apr 24 13:40:29 UTC 2006


On 4/23/06, Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org> wrote:
>   I want to start using rsync instead of cp or scp to back up my system.
> Since my 160 gig "bigdrive" is USB 1.1 (don't ask), wiping the old copy
> of /mnt/bigdrive/waltdnes/ and copying over my entire /home/waltdnes/ is
> painful.  Just doing the differences will obviously save time.
>
> 1)  Do I understand correctly that rsync will ensure that the copy is
> identical to the source, i.e. local files that I've changed since the
> last rsync will be changed on the copy, local files that have been
> added and deleted will be added and deleted, respectively, on the copy?
> I want to mirror my local directory.
>

I use rsync to mirror my home directory to an external USB drive. To
ensure that deleted files are also removed on your backup drive
requires the "--delete" option. For example, to mirror my home
directory to my backup drive mounted at "/media/backup" I execute:

rsync -av --delete /home/daniel/ /media/backup/daniel/

Be careful using the delete option. Before running this command, its
good to do a test run using the "-n" option:

rsync -avn --delete /home/daniel/ /media/backup/daniel/ | less

...and just page through the output to ensure that rsync is doing what
you want it to do. Some things like the cache directory in Firefox you
might want to exclude to save time:

rsync -av --delete --exclude "Cache/" /home/daniel/ media/backup/daniel/
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list