Re: Heads up: gtar gone from base system

From: Stephen McKay (smckay_at_internode.on.net)
Date: 03/30/05

  • Next message: Søren Schmidt: "HEADSUP: ATA mkIII has been committed"
    To: freebsd-current@freebsd.org
    Date: Wed, 30 Mar 2005 21:39:22 +1000
    
    

    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.

    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"


  • Next message: Søren Schmidt: "HEADSUP: ATA mkIII has been committed"

    Relevant Pages

    • 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: 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. ...
      (freebsd-current)
    • 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)