Is it possible to continue incomplete tar jobs?

2

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

Andrew Grimm

Posted 2009-10-13T23:19:30.697

Reputation: 2 230

Answers

3

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.

quack quixote

Posted 2009-10-13T23:19:30.697

Reputation: 37 382