Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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)?

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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