1

I've a .tar backup, when I try to extract using below command.

tar -xvf backup.tar 

Nothing is extracting and no errors or warning

Seems like its corrupted. Is there any way to recover the .tar backup?

Augustin
  • 281
  • 1
  • 3
  • 11

2 Answers2

1

If tar fails to work due to a corrupted file, sometimes cpio is your friend:

cpio -ivd -H tar < backup.tar

cpio has been known to skip corrupted parts in a tar file. In this case you'll see a message about "skipping N bytes of junk".

A.P.
  • 1,416
  • 9
  • 11
  • Tried running cpio, cpio -ivd -H tar < backup.tar 1 block this is the output, I'm seing – Augustin Oct 11 '15 at 00:38
  • What does `file backup.tar` say? Is the archive even recognized as a tar one by `file`? Maybe it's compressed? – A.P. Oct 11 '15 at 10:22
  • This is a backup file created by VestaCP control panel. – Augustin Oct 11 '15 at 15:27
  • 1
    @Augustin (A) so what does `file backup.tar` say? (B) Maybe a command like `v-restore-user` would help (see https://vestacp.com/docs/)? – A.P. Oct 11 '15 at 18:53
0

Try solution from https://unix.stackexchange.com/a/96431/582295 i.e. -i. I had 209G archive that extracted only to 90G files with xf, but using xfi i was able to extract additional files (with some error at the end, but still better than nothing).