RFC: alias tar="tar --backup" ?

Micah Cowan micahcowan at ubuntu.com
Fri May 18 00:25:53 UTC 2007

Jan Claeys wrote:
> Op donderdag 17-05-2007 om 15:18 uur [tijdzone -0700], schreef Micah
> Cowan:
>> A user, timothy, describing his difficulties at:
>> https://bugs.launchpad.net/ubuntu/+bug/113154
>> describes his frustration as a new user, in discovering the hard way
>> that tar's default is to overwrite existing files, causing him to lose
>> important data.
>> While I'm opposed to fixing the problem in tar itself, as traditional
>> usage frequently relies upon this behavior, I don't see why we
>> couldn't make the experience of using tar interactively a little
>> safer, by providing a default alias for tar in /etc/skel/.bashrc that
>> backs-up existing files. 
> I think GUI archive tools should ask or backup before overwriting by
> default, but changing the behaviour of command line tools might cause
> problems.

Well, the nice thing about aliasing it instead of actually changing the
tool's behavior, is that it will only effect interactive sessions, and
can easily be overridden/removed by the user.

The only sorts of hiccups I can think of is cases such as when someone
is tracking third-party software, and expects to be able to just tar -x
the archive over the previous contents in the working copy, and check in
the differences. If the user's not watching, the alias could cause the
user to accidentally check in the backup files as well.

However, as I said, the alias could be removed once the user sees what's
going on, or the user could explicitly invoke \tar. And this situation
seems less offensive than the current situation, which is the potential
for destructive data loss.

Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20070517/c99109c3/attachment.sig>

More information about the Ubuntu-devel-discuss mailing list