helpGNU tar - Support: sr #109180, Overwrite option

 
 

sr #109180: Overwrite option

Submitted by:  Alexander Chikovany <justrp>
Submitted on:  Tue 08 Nov 2016 06:48:33 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 08 Nov 2016 09:34:23 PM UTC, comment #1:

I'm sorry, have a typo in last sentence:
< "mydir/dir-will-be-link is symbolic link to /dev/null"
should be

> "mydir/link-will-be-dir is symbolic link to /dev/null"

Alexander Chikovany <justrp>
Tue 08 Nov 2016 06:48:33 PM UTC, original submission:

Hello.

I've asked for help at -unavailable- and Pavel Raiskup said that option I need is not implemented, so I will post about it here.

I think, tar should have an option to overwrite files (any type of files: files, directories, symbolic links, etc) if there were any changes (like if content of file was changed or type of file was changed).

For example, I will archive my directory with subdir with file1 and symlink "link-will-be-dir". After that, I well add file2 to my subdir, remove symlink, create directory with same name as link I had ("link-will-be-dir") and create file inside of it.
Now, I want to extract my archive into that dir - and have file1 and file2 inside of subdir - and 'link-will-be-dir' as directory (since it was directory when I had packed an archive):
➜ ~ mkdir -p mydir/dir-with-files
➜ ~ ln -s /dev/null mydir/link-will-be-dir
➜ ~ touch mydir/dir-with-files/file1
➜ ~ tar -cf mybackup.tar mydir/
➜ ~ rm -f mydir/link-will-be-dir
➜ ~ mkdir -p mydir/link-will-be-dir
➜ ~ touch mydir/dir-with-files/file2 mydir/link-will-be-dir/file-should-be-deleted-after-extract-since-its-parent-dir-become-symlink
➜ ~ tar -x --some-awesome-flag mybackup.tar
and now i want it to have:
mydir/dir-with-files contains file1 and file2
mydir/dir-will-be-link is symbolic link to /dev/null

Alexander Chikovany <justrp>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by justrp (Submitted the item)
  • -unavailable- added by justrp
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 08 Nov 2016 06:48:33 PM UTCjustrpCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1