tar command to backup Ubuntu system ?
I have a really nice Ubuntu install tweaked, complete with all the software apps I need, Compiz effects, etc. I would like to back it up in case it succumbs to a case of fubar from either something i do or a system update/upgrade. I have used Clonezilla to do some partition cloning, but sometimes that does not work. I am getting better at learning Grub2 so I am feeling better about being able to restore Grub2 if needed, so I think a tar backup might suffice. Just that I want to be clear on a tar command to do what needs doing.
So say my Windows 7 system is on /dev/sda, my Ubuntu system ("/") is on /dev/sdb1, my /home is on /dev/sdb2, and I have an ntfs data drive with folders on /dev/sdc1 (that data drive is automagically mounted at boot by my Ubuntu system as /datadrive).
What tar command could I use to tar my Ubuntu system ("/") to /dev/sdc1 (without destroying that drive of course!), including the use of bzip? I want the highest compression, am willing to sacrifice execution time for highest compression. I have read it is important for such a tar to use excludes to exclude the .bzip tar file itself as well as various volatile system folders/files that do not need to be tarred because they are created during boot and only exist temporarily.
I came across this post on backing up an Ubuntu system using tar
but I want to understand it better and I want to be able to do such a tar backup where the tar archive is created and stored on /datadrive
From a terminal command line shell in my Ubuntu system, would this do what I need done?
$ sudo tar -cbvf /datadrive/backup.tar.bz2 /
My concern is that such a tar command would also try to include the automagically mounted /windows and /datadrive folders, which of course would be a disaster; so should i exclude them like this:
$ sudo tar -cbvf /datadrive/backup.tar.bz2 --exclude=/datadrive --exclude=/windows /
Last edited by Coder88; September 8th, 2013 at 02:02 PM.
Tags for this Thread