i sync my master and slave servers using rsync, but recently my source hard disk is going out of free space, so i copied (native copy using cp) source files to a new high capacity hard disk. but after replacing the source hard disk my slave server started to sync whole files( it assumed that all files are new files!)

There is another method to duplicate source files in new hard disk?

3 Answers 3


This is because timestamp has been changed when the files are copied. You can preserve the files attributes including timestmap using -p option. See man cp for more info.


it's because of the timestamps which rsync uses to check if there was any change - cp by default does not preserve them so now rsync will have to checksum content of each file before it can decide that there was no content change, just the metadata change.

  • any way to duplicate sources with same time stamps?
    – Mehdi
    Aug 26, 2012 at 13:29
  • @Mehdi sorry - can you please reword your question?
    – pQd
    Aug 26, 2012 at 14:00

I would have chose a different option than cp.

  • rsync which it appears you are already using. I would use the archive flag.
  • tar in a pipeline. This can be piped between servers using ssh if needed.
  • cpio which I use rarely, but should handle this in a single process unlike the tar solution.
  • thanks. I think tar rsync with archive flag is best soloution, however i used cp using -p flag!
    – Mehdi
    Aug 27, 2012 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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