CentOS 9.x tar

From Notes_Wiki

Home > CentOS > CentOS 9.x > CentOS 9.x Command line tools and utilities > CentOS 9.x tar

Resume a tar.gz command that was killed

Support a file is being created using:

tar czf backup.tar.gz /mnt/backup

But the process is killed in between. Now instead of re-compressing all the files which are part of backup.tar.gz already, it is possible to create another .tar.gz file with remaining data. To do that use:

cd ~
tar ztf backup.tar.gz | sed -e '/\/$/d' -e x -e '/^$/d' >files-done
tar czfX backup2.tar.gz files-done /mnt/backup

The first tar command might show error about unexpected end or corrupted tar file. We can ignore that. The last file in the first tar is most likely not stored properly. The above steps ensure that the last file is again stored in the new tar file. Thus, ensuring all files are backed up properly.

Refer:




Home > CentOS > CentOS 9.x > CentOS 9.x Command line tools and utilities > CentOS 9.x tar