Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tar cjpf /path/to/save/at/stage4.tar.bz2 / -X stage4.excl
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jotte
n00b
n00b


Joined: 03 Feb 2006
Posts: 11

PostPosted: Sat Oct 21, 2006 2:09 pm    Post subject: tar cjpf /path/to/save/at/stage4.tar.bz2 / -X stage4.excl Reply with quote

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
View user's profile Send private message
Telexen
Apprentice
Apprentice


Joined: 09 Oct 2005
Posts: 189

PostPosted: Sat Oct 21, 2006 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Syque
Tux's lil' helper
Tux's lil' helper


Joined: 15 Aug 2004
Posts: 110

PostPosted: Sat Oct 21, 2006 3:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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