[kde-doc-english] about the "tar" command

Marcel van de Vel marcel at cs.vu.nl
Tue Mar 6 20:26:51 CET 2007


LS,

	Today, I had an accident with the "tar" command (version 1.14, 30 November 2006) 
that made me loose the work of hours. From my earlier experiences with "tar", I 
believed that it should not overwrite new files with older ones. It does, and, 
even more amazingly, a deliberate design choice dictates a complicated option 
"--keep-newer-files" to prevent this (as I discovered only after the damage occured).
	Apparently, it is believed that the situation does not normally occur. It does. 
At my job, I have a pc, and also a laptop to work at home. I regularly use tar 
files to transfer data from the pc to the laptop and vice versa. There are two 
ways for this: one is to pack only the files that changed (with a risk of 
forgetting one); the other is to get all files around, both changed and unchanged. 
With due care, this never went wrong when I had an older "tar", but the current 
version considerably increases the risk of a clash.
	The principle to be followed by "tar" should clearly be this:

--> When a newer file is going to be replaced by an extracted older one, it is 
most probably not intentional. Only an explicit option may allow "tar" to do it; 
not the other way round. Isn't this common sense?

	Let me take the occasion to report another type of accident with "tar", that 
could easily be prevented. When composing a list of argument files for "tar", I 
sometimes forget to name an archive file (more often I noticed this just in time 
before pressing "return"). As a result, the first named argument file is used and 
overwritten. Such disasters could be avoided if "tar" would insist on a standard 
postfix (like ".tgz") when creating an archive, with an explicit option to make 
"tar" more tolerant on (absence of) postfixes.

Taking these suggestions into consideration would be of help to avoid some 
unnecessary problems with a very useful command.

Sincerely,
M. van de Vel
Vrije Universiteit Amsterdam



More information about the kde-doc-english mailing list