fixing user, group, and mtime with rsync? - Tools

This is a discussion on fixing user, group, and mtime with rsync? - Tools ; 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. ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: fixing user, group, and mtime with rsync?

  1. fixing user, group, and mtime with rsync?

    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

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

  2. Re: fixing user, group, and mtime with rsync?

    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.
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  3. Re: fixing user, group, and mtime with rsync?

    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

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  4. Re: fixing user, group, and mtime with rsync?

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

    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

  5. Re: fixing user, group, and mtime with rsync?

    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

    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


  6. Re: fixing user, group, and mtime with rsync?

    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
    --
    Please use reply-all for most replies to avoid omitting the mailing list.
    To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
    Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


+ Reply to Thread