0

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?

Mehdi
  • 103
  • 3

3 Answers3

2

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.

Khaled
  • 36,533
  • 8
  • 72
  • 99
1

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.

pQd
  • 29,981
  • 6
  • 66
  • 109
0

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.
BillThor
  • 27,737
  • 3
  • 37
  • 69
  • thanks. I think tar rsync with archive flag is best soloution, however i used cp using -p flag! – Mehdi Aug 27 '12 at 04:34