Hi all. I prepared a mirror (that is intended to be updated by rsync) by doing the initial copy using cpio (for efficiency on 15 million files). Unfortunately, user, group, and mtime of some directories and files was copied incorrectly. Can I use rsync (GIT) to fix this? Greetings Sven -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20080915/17843dfb/attachment.bin
Sven Hartrumpf (Sven.Hartrumpf@FernUni-Hagen.de) wrote on 15 September 2008 14:05: >I prepared a mirror (that is intended to be updated by rsync) >by doing the initial copy using cpio (for efficiency on 15 million files). >Unfortunately, user, group, and mtime of some directories and files >was copied incorrectly. > >Can I use rsync (GIT) to fix this? rsync --times -av from/ to/ works for me. Should work for different machines also.
On Mon, 2008-09-15 at 14:05 +0200, Sven Hartrumpf wrote:> I prepared a mirror (that is intended to be updated by rsync) > by doing the initial copy using cpio (for efficiency on 15 million files). > Unfortunately, user, group, and mtime of some directories and files > was copied incorrectly. > > Can I use rsync (GIT) to fix this?Yes, use rsync with the -a option. Also pass --size-only to avoid resending the data of regular files due to the difference in mtime. Matt
Mon, 15 Sep 2008 15:21:37 -0400, matt wrote:> On Mon, 2008-09-15 at 14:05 +0200, Sven Hartrumpf wrote: > > I prepared a mirror (that is intended to be updated by rsync) > > by doing the initial copy using cpio (for efficiency on 15 million files). > > Unfortunately, user, group, and mtime of some directories and files > > was copied incorrectly. > > > > Can I use rsync (GIT) to fix this? > > Yes, use rsync with the -a option. Also pass --size-only to avoid > resending the data of regular files due to the difference in mtime.Thanks Matt, that worked almost perfectly and was very quick for the 15 million files! The mtime of soft links was not corrected. Is this expected? Sven -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20080916/db7fb915/attachment.bin
On Tue, 2008-09-16 at 10:02 +0200, Sven Hartrumpf wrote:> Mon, 15 Sep 2008 15:21:37 -0400, matt wrote: > > > On Mon, 2008-09-15 at 14:05 +0200, Sven Hartrumpf wrote: > > > I prepared a mirror (that is intended to be updated by rsync) > > > by doing the initial copy using cpio (for efficiency on 15 million files). > > > Unfortunately, user, group, and mtime of some directories and files > > > was copied incorrectly. > > > > > > Can I use rsync (GIT) to fix this? > > > > Yes, use rsync with the -a option. Also pass --size-only to avoid > > resending the data of regular files due to the difference in mtime. > > Thanks Matt, > that worked almost perfectly and was very quick for the 15 million files! > The mtime of soft links was not corrected. Is this expected?Rsync will preserve symlink mtimes using the lutimes system call if the C library and kernel on the receiving machine both support it. Check that "rsync --version" shows "symtimes", not "no symtimes". If the kernel is Linux, it should be 2.6.22 or newer (IIRC). Matt
Tue, 16 Sep 2008 17:35:40 +0000, matt wrote:> Rsync will preserve symlink mtimes using the lutimes system call if the > C library and kernel on the receiving machine both support it. Check > that "rsync --version" shows "symtimes", not "no symtimes". If the > kernel is Linux, it should be 2.6.22 or newer (IIRC).Thanks for the explanation. I rebuilt rsync using openSUSE 10.3 (and 11.0). Both use symtimes now. Before I configured on openSUSE 10.2 (= kernel 2.6.18) which was not enough as you said. Ciao Sven