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

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?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
any way to duplicate sources with same time stamps? –  Mehdi Aug 26 '12 at 13:29
    
@Mehdi sorry - can you please reword your question? –  pQd Aug 26 '12 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.
share|improve this answer
    
thanks. I think tar rsync with archive flag is best soloution, however i used cp using -p flag! –  Mehdi Aug 27 '12 at 4:34

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.