Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just bought a 1.5T HDD and a disk enclosure. I connected this disk to my laptop via the provided USB cable. I then used the following command:

rsync -r -t -v --progress --delete -c -l -z / /media/C4E41A11E41A0678/Moonface_BKP/

I ran this for a long (long long) time when i noticed that what had been backed up to the HDD began to be backed up. In other words, when i ran the command, it created a /media directory and a C4... directory below that and kept recursively backing up this directory (since, I suppose, I was backing up the hard drive itself, too).

So...what's the proper way to use rsync?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

My personal favorite way to backup on Linux is Back In Time. It's basically a frontend for rsync oriented towards backup, but it's extremely easy.


But for your rsync command, I'm pretty sure you can get away with just syncing /home which is where anything irreplaceable is anyway, so you could run

rsync -r -t -v --progress --delete -c -l -z /home/ /media/C4E41A11E41A0678/Moonface_BKP/

or if you really need to just exclude /media,

rsync -r -t -v --progress --delete --exclude /media/ -c -l -z / /media/C4E41A11E41A0678/Moonface_BKP/

You may also want to include -a and combine the other letters, making your end result

rsync -arvcz --progress --delete --exclude /media/ / /media/C4E41A11E41A0678/Moonface_BKP/
share|improve this answer
    
i think their might be a typo? should that instead be -z /home/? –  Ramy Dec 29 '10 at 5:18
    
@Ramy updated. Actually, come to think of it, I don't think -z is a good idea either. It only compresses on data transfer, which while makes it a bit faster (this is on the fly compression, not that good), will also strain on the CPU. –  digitxp Dec 29 '10 at 5:22
    
ah, ok. cool. Thanks for all the info and help! –  Ramy Dec 29 '10 at 5:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.