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 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

1 Answer 1

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

 
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.