Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create simple backup script that copies some files to timestamped directory on the remote machine - this part is working quite OK, because I didn't run into issues like e.g network connectivity yet.

I would like to know what is recommended practice for checking if my files were copied correctly.

I was thinking about 2 ways to do this:

  • Check file sizes/md5 before copying them and compare them with ones on remote machine
  • Always copy one more file that will be copied last (like 1 byte file) and then check if it exists on remote machine.
share|improve this question
up vote 5 down vote accepted

I'd go with rsync, if it returns an exit code of 0, all is well. If it's not zero, the exit codes are well documented, so your script could tell you exactly what the problem was.

share|improve this answer

Your Answer


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.