10
2011
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’
Step 1.
cd into the directory holding the archive.
Step 2.
# 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.
Step 1.
cd into the directory holding the archives.
Step 2.
# tar -xpzf backup0.tar.gz --listed-incremental=/dev/null -C /home/rabi
(This file should be a level 0 backup file. )
Step 3.
# 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.
Step 1.
cd into the directory holding the split archives.
Step 2.
# 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
Subscribe to fortystones.
Follow @fortystones on Twitter.
Get updated from our Facebook Fanpage.
2 Comments + Add Comment
Leave a comment
Fortystones Lab Projects
Categories
- No categories
Popular Posts
- 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

An article by






[...] on the series of linux backup stones, I give you Tips for Backup and Restore. These are short but essential tips on Backup and Restore in [...]
[...] script which on execution will back up your linux system. If you are not familiar with Backup or Restore, I highly recommend you go through our previous stones on Backup your Linux System, Restore your [...]