Restore your Linux Backup
In my previous post on Backup your Linux System, a brief introduction on Backup and the three types of Backup were explained. Once we have backups of our important documents, we should be able to restore those backups. Ergo, in this post, I will explain how to restore backups using the GNU version of ‘tar’ Backup Utility.
But, before you begin reading this post, I highly recommend you to go through ‘Backup your Linux System’ if you are not confident in backing up your system.
Restoring ‘Full Backup’
cd into the directory holding the archive.
# tar -xpzf backup.tar.gz -C /home/rabi
Here, backup.tar.gz is the archive i.e. the source file and /home/rabi is the path to restore the files in the archive.
Restoring Incremental Backup
While performing Incremental Backup, we had created Snapshot files (as our test.snar file mentioned in previous post ). A Snapshot file is a standalone file that helps to determine which files have been changed, added or restored since last backup. Since, GNU tar will delete all those files that did not exist in their directories when the archive was created, we must be careful with Snapshot files.
cd into the directory holding the archives.
# tar -xpzf backup0.tar.gz --listed-incremental=/dev/null -C /home/rabi
(This file should be a level 0 backup file. )
# tar -xpzf backup1.tar.gz --listed-incremental=/dev/null -C /home/rabi
(This file should be a level 1 backup file. )
and so on..
Similarly, we can restore Differential Backups provided we know the order of our Snapshot files.
List files in the archive
If you are not sure what files are in the archive, you can use the –list or -t option to peek in the archives.
# tar --list --file backup.tar.gz
Reconstitute the Splitted Archive
I had shown you how to split the archive during creation or after the creation. So, now we will be reconstructing the complete archive.
cd into the directory holding the split archives.
# cat *tar.gz* | tar -xvpzf - -C /
(This will write all the archives into one and pass all that through standard output to tar to be extracted into root.)
Restore -bzip2 archive
# tar -xvpjf backup.tar.bz2 / home/rabi
2 Comments + Add Comment
Leave a comment
- No categories
- 40 Basic Linux Command-line Tips and Tricks
- Tips and Tricks for Facebook Chat (Save History/ Video Chat/ Send Files)
- 40 Linux Shell Commands for Beginners
- Creating a Simple GUI for Absolute Beginners (Java Tutorials)
- Online Coding Zones for Programmers
- Special: Facebook Smiley, Special Text Symbols and ASCII Arts
- The First on the World Wide Web