Advertisement
v1ral_ITS

awesome file system backup

Jul 19th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.26 KB | None | 0 0
  1. Another way you can back up your hard drive on Linux is with TAR. Tar is a bit different from other backup solutions on this list. Unlike Gnome Disk Utility, DD or Clonezilla, you won’t be making an exact copy of your drive. Instead, you’ll be compressing an exact copy of your entire Linux file system into a TAR archive.
  2.  
  3. This can be accomplished with just two commands. Open a terminal and enter the following:
  4.  
  5. cd /
  6.  
  7. The cd command puts us in the / directory (or root). This is the home to all files on your Linux installation. After that just run the backup command and sit back.
  8.  
  9. sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system /
  10.  
  11. Once the command above has finished its run, look for the backup.tar.gz file inside the / folder and save it to an external file system. If ever you lose some files that need to be restored, just run the following command to restore them:
  12.  
  13. sudo tar -xvpzf /path/to/backup.tar.gz -C /restore/location --numeric-owner
  14.  
  15. Conclusion
  16.  
  17. Keeping a backup is important when using an operating system. You never know what’s going to happen with your data. There are many, many backup tools for Linux. This list covers the most popular. There is no doubt there are others out there that can back up drives just as well.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement