Re-send, as my "send" hotkey was trigger-happy on the last message (please
disregard the previous).
Hi all -- have run into this bit of weirdness today, and I was hoping
someone here could either confirm it as a bug or tell me how I am utterly
confused about how these options function. My intent is to extract an
archive onto the local system and to never overwrite or otherwise modify
existing files (i.e. to "fill in the blanks" onto the local system by
extracting missing files out of an archive).
I'm attempting to do this with a command like this:
tar --bzip2 --extract --file "${ARCHIVE}" --keep-old-files
--no-overwrite-dir --preserve-order --preserve-permissions
... this command overwrites any existing files with old versions from the
archive, however (which is the opposite of what I would expect).
Playing around on my local system I was able to replicate this behavior:
$ mkdir tar-test
$ cd tar-test/
$ echo ARCHIVE_DATA>FILE
$ cat FILE
ARCHIVE_DATA
$ tar cf /tmp/tar-test.tar *
$ rm FILE
$ tar xf /tmp/tar-test.tar
$ cat FILE
ARCHIVE_DATA
$ echo NEW_DATA >FILE
$ cat FILE
NEW_DATA
$ tar xf /tmp/tar-test.tar # This should overwrite the file.
$ cat FILE
ARCHIVE_DATA
$ echo NEW_DATA >FILE
$ cat FILE
NEW_DATA
$ tar kxf /tmp/tar-test.tar # This should NOT overwrite the file.
$ cat FILE
NEW_DATA
$ tar kxf /tmp/tar-test.tar --no-overwrite-dir # This should NOT overwrite
the file, but it does.
$ cat FILE
ARCHIVE_DATA
All of this is with Debian's oldstable version of tar:
$ tar --version
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
Is anyone able to lend some clarity as to what exactly is going on and why
adding --no-overwrite-dir is causing tar to overwrite files that it
explicitly shouldn't?
Thanks!
Remi
--
Remi Broemeling
System Administrator
Clio - Practice Management Simplified
1-888-858-2546 x(2^8) | [email protected]
www.clio.com | blog <https://www.clio.com/blog> | twitter
<http://www.twitter.com/goclio> | facebook <http://www.facebook.com/goclio>
Let's talk. Join the Official Clio Community on LinkedIn
<http://ow.ly/C0zBL>.