Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to use rsync to back up a remote Linux server

I'm running DeltaCopy as a server on my desktop PC (Win7/64), and running rsync by SSH'ing to the Linux box, sudo'ing to root, and doing something like (slightly obfuscated, for obvious reasons):

rsync -azv --modify-window=1 \
--exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found/*} \
--log-file=/var/log/rsync.log /* rsync://obfuscated@1.2.3.4/MyBackup

It seems to be working, but I'm worried that there might be one or more files that didn't get copied and are quietly falling between the cracks.

Is there any straightforward way to get rsync to generate a concise list of files on the Linux box that SHOULD have gotten copied, but either didn't get copied, or are different, so I'll know which ones need special attention (MySQL InnoDB, etc)?

Also, given the above example, what changes should I make for subsequent runs in order to replace the copy with newer versions if something has changed?

share|improve this question
    
rsync will print a message on stderr if it fails to transfer a file -- is that what you're looking for? –  mgorven May 24 '13 at 20:22

2 Answers 2

Try the following option:

--dry-run
share|improve this answer
    
I'm not sure this answers the question. It will show what rsync would have done, but not verify that it got everything (which it would, but...). –  Falcon Momot May 24 '13 at 19:32
    
You can also use --checksum to ensure that if rsync skips a file it is based on the checksum and not just the file size and date. –  Jack May 28 '13 at 12:48

According to the rsync manual, the -v option will tell which files are gonna be copied. You could then take these filenames and create a script that runs thru both systems and perform a md5 sum. You could then diff the files and if necessary scp the files with different md5.

share|improve this answer

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.