help-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-tar] Overwrite options


From: Pavel Raiskup
Subject: Re: [Help-tar] Overwrite options
Date: Tue, 01 Nov 2016 09:04:20 +0100
User-agent: KMail/5.3.1 (Linux/4.7.9-200.fc24.x86_64; KDE/5.26.0; x86_64; ; )

On Tuesday, November 1, 2016 2:56:23 AM CET address@hidden wrote:
> Hello.
> I don't know if it is a bug or something like that.
> What flag should I use if I want to overwrite existing non-empty directory by
> symlink from my tar archive?

There's --recursive-unlink.  But I would be careful to explicitly select
proper set of files to be extracted, rather then extract the whole archive
(there's high chance this will cause some disaster).

Documentation: info tar -n "Recursive Unlink"

Pavel

> I've tried --overwrite flag and -U, that did not
> work. Tried with tar version 1.29 and 1.28.  Here is example:
>  
> ➜  ln -s /dev/null test
> ➜  tar -cf archive.tar test
> ➜  rm -f test
> ➜  mkdir -p test/something
> ➜  tar --overwrite -xf archive.tar  
> tar: test: Cannot open: File exists
> tar: Exiting with failure status due to previous errors
> ➜  tar -U -xf archive.tar 
> tar: test: Cannot unlink: Directory not empty
> tar: Exiting with failure status due to previous errors
> ➜  rmdir test/something 
> ➜  tar --overwrite -xf archive.tar
> ➜  echo $?
> 0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]