bugGNU tar - Bugs: bug #58485, Overwriting existing archives


bug #58485: Overwriting existing archives

Submitter:  Pascal <pascal666>
Submitted:  Tue 02 Jun 2020 06:41:49 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Tue 02 Jun 2020 06:41:49 PM UTC, original submission:  

I accidentally ran the same command twice:
tar --remove-files -cf ../2019-09.tar 2019-09-

The second invocation replaced the tar file containing my data with an empty one, even though it died with the error messages:
tar: 2019-09-: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

It would be nice if tar did not create a new tar file until it actually had something to write to it, but I imagine that change would break some existing scripts.

Perhaps if there was a command-line option I could pass to tar via bashrc to get a warning before overwriting existing files in the future (similar to "alias mv='mv -i'").

Thank you.

Pascal <pascal666>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by pascal666 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code