View previous topic :: View next topic |
Author |
Message |
jotte n00b
Joined: 03 Feb 2006 Posts: 11
|
Posted: Sat Oct 21, 2006 2:09 pm Post subject: tar cjpf /path/to/save/at/stage4.tar.bz2 / -X stage4.excl |
|
|
I'd like to make a full backup of my Gentoo system to another disk and partition. I found in Gentoo-wiki, that it can be done with the following command:
tar cjpf /path/to/save/at/stage4.tar.bz2 / -X stage4.excl
The excl -file is made of
.bash_history
/dev/*
/mnt/*
/tmp/*
/proc/*
/sys/*
/usr/src/*
/usr/portage/*
/path/to/save/at/stage4.tar.bz2
My problem is: how to make this excl -file? In addition there are a couple of folders in / and /mnt, which I want to exclude from this backup. How can I do this? |
|
Back to top |
|
|
Telexen Apprentice
Joined: 09 Oct 2005 Posts: 189
|
Posted: Sat Oct 21, 2006 3:03 pm Post subject: |
|
|
Just use nano or your favorite text editor and put those in the stage4.excl, then add yours ... such as
.bash_history
/dev/*
/mnt/*
/tmp/*
/proc/*
/sys/*
/usr/src/*
/usr/portage/*
/whatever/*
all other folders in /mnt/ will be removed (I leave /mnt/* out of mine, and make sure everything is unmounted) |
|
Back to top |
|
|
Syque Tux's lil' helper
Joined: 15 Aug 2004 Posts: 110
|
Posted: Sat Oct 21, 2006 3:08 pm Post subject: |
|
|
Use your favorite text editor (nano is installed by default on Gentoo) to make the stage4.excl file, with one entry per line, like the one you posted.
The file you've given will exclude all files and subfolders in /mnt (look at the /mnt/* line). If you wanted to exclude only some subfolders of /mnt, you'd delete the /mnt/* line your stage4.excl file would include the lines
/mnt/some_folder
/mnt/other_folder/*
The difference between the two is that /mnt/other_folder will be included in the tar file, but nothing contained in /mnt/other_folder will be in the backup tar file. However, /mnt/some_folder won't be included at all in the tar file (neither will anything in it, of course). The same rules apply in /. If I want to exclude /opt and and everything in it:
/opt
should be a line in the stage4.excl file. If I want to keep the /opt folder but not backup anything contained in it,
/opt/*
will put a folder named /opt in the tar file but won't include anything contained in /opt.
You might also consider reading either the man page (man tar) or the info page (info tar), which is supposedly more complete, but I'd recommend trying the man page first. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|