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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .