up vote 1 down vote favorite
share [g+] share [fb]

Is it safe to continue an incomplete tar job?

Background: I was doing

tar -czvf backup_20091013.tar.gz directory1 directory2 ... > tar_log_20091013.txt

and to be safe, I put the shell window on the second desktop. A couple of hours later, I logged out (thinking that there was nothing running!), which seems to have stopped the tarring and gzipping. It got most of the way through, so I'm half-tempted to continue that job. Is there a risk of corruption (either to the whole archive, or the archived copy of the file being tarred and gzipped at the time I logged out)?

link|improve this question

68% accept rate
feedback

1 Answer

up vote 2 down vote accepted

Your original files are safe. Whether the tarball you made is readable is a whole different question -- whether you can a) gunzip it and b) untar it are two different potential points of failure. I don't think they are recoverable, but I'm really not sure.

I wouldn't risk the chance of a corrupted backup file -- delete it and start the job again.

Tip: run screen first, so if your terminal gets disconnected for some reason, the tar will continue.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.