Re: Heads up: gtar gone from base system

From: Julian Elischer (julian_at_elischer.org)
Date: 03/30/05

  • Next message: Martin Nilsson: "Re: ciss(4): speed degradation for Compaq Smart Array [edited]"
    Date: Wed, 30 Mar 2005 11:55:01 -0800
    To: Stephen McKay <smckay@internode.on.net>
    
    

    Stephen McKay wrote:

    >On Tuesday, 29th March 2005, Peter Jeremy wrote:
    >
    >
    >
    >>Brian missed a pair of parenthenis. The example should read:
    >>
    >>( cd srcdir ; tar cf - . ) | ( cd destdir ; tar xpf - )
    >>
    >>
    >
    >Tar is indeed a most excellent program for copying directory trees, since
    >even in this modern century cp fails to correctly handle hard links. Sigh.
    >
    >

    I find "find -depth |cpio -pdmuv" is better because
    it has the option of being run as:
    find -depth |cpio -pdmv which will only update new files .
    this is excelent if you stop it half way through for some reason and want
    to continue the copy.. good if you want to keep one tree in sync with
    another.

    also find -depth |cpio -pdlmuv is good if you want a 'linked' copy of a
    directory
    where all the files are hardlinks of the original.

    >Still, if you are using tar, be sure to use it correctly:
    >
    >( cd srcdir && tar cf - . ) | ( cd destdir && tar xpf - )
    >
    >You don't want it going off in the current directory and mangling things
    >just because of a little typo in a directory name.
    >
    >Stephen.
    >
    >PS If I'm right, the new tar fixes something gtar got wrong: setting
    >permissions on "." when it is part of the archive, which of course it is
    >when you copy directories in this way. This may surprise new users, even
    >though it is the only sensible result.
    >
    >PPS Who's for adding a "cp -h" option to copy preserving hard links?
    >_______________________________________________
    >freebsd-current@freebsd.org mailing list
    >http://lists.freebsd.org/mailman/listinfo/freebsd-current
    >To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    >
    >
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Martin Nilsson: "Re: ciss(4): speed degradation for Compaq Smart Array [edited]"

    Relevant Pages

    • Re: Heads up: gtar gone from base system
      ... >> Tar is indeed a most excellent program for copying directory trees, ... >> even in this modern century cp fails to correctly handle hard links. ... Using pax instead of tar because cp doesn't work properly is still a hack, ...
      (freebsd-current)
    • Re: Heads up: gtar gone from base system
      ... Tar is indeed a most excellent program for copying directory trees, ... even in this modern century cp fails to correctly handle hard links. ... PPS Who's for adding a "cp -h" option to copy preserving hard links? ...
      (freebsd-current)
    • Re: Find hard links?
      ... >>between two hard links that represent the same file. ... I have a nightly cron job ... > that uses tar to back up my home directory to an external drive. ... absolute filenames, e.g. ...
      (Fedora)
    • Re: 3B1 Floppy backup advice
      ... Cygwin will create hard links on Windows, and it seems to be acceptable to ... examining the scripts which did the backups. ... I recall in the 3B1 era that cpio was a friendlier tool than tar. ...
      (comp.sys.3b1)
    • GNU tar 1.20
      ... I am pleased to announce the release of GNU tar 1.20. ... GNU tar is available for download from ... dereferences hard links and stores the files ...
      (gnu.announce)