I will try this out but dont know success or not
I will try this out but dont know success or not
5+ for this guide.
it was a life saver
Hello,
I included --exclude=/media to the back up command but the back up still seemed to back up the thumb drive... I can just unpulg the thing but what am I doing wrong?
Code:tar cvpzf backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys --exclude=/media ... /media/ /media/cdrom /media/cdrom0/ /media/SWIJUMP/ /media/SWIJUMP/-1_PodCasts/ /media/SWIJUMP/-1_PodCasts/this WEEK in TECH - MP3 Edition/ ...
Thank you,
--Shoki
Use sbackup. It's just a shell for tar, but it is so much easier to use.
this whole thing sounds really great, but i have very annoying problem with 'tar' command: it won't exclude anything! No matter what i did, it just kept ignoring --exclude=/dir statements ...could anyone, please, give me the solution, cause i have to backup my system as soon as possible. thanx.
I believe it's easiest to use the -X option in tar (long form is --exclude-from). Just make a text file called, say, exclusions, with the name of one file or directory you don't want backed up on each line of the file. Then put in your tar command -X exclusions (or --exclude-from exclusions) and tar will exclude the files it finds recorded in the file you wrote. When you want to change exclusions it's easy, because you just have to modify that simple text file instead of maybe making a mistake in some long tar command line.
I hope this helps.
well, what i did was:
1. i gedited file 'exclusions' in my home dir:
"/media
/... " (so, i put each dir in a separate line)
2. i went to /media/hdb5 (which is the partition i want to put backup.tgz on) and typed:
$ tar cvpzf backup.tgz / --exclude-from=/home/myUsername/exclusions
i also tried -X, and nothing happened: tar kept ignoring exclusion statement. i am a newbie, as you can see, but this IS the right syntax for tar, is it not? i'm affraid that i'll have to ask for a complete 'idiot friendly' instructions
it seems it's not , when i entered:
$ tar --exclude-from=/<path-to-file> -cvpzf backup.tgz /
tar finnaly excluded those files. Jonrkc, thank you very much for helping me. I really think this is more elegant solution.
I just wanted to ask few more things: even though it seems from the console output that it packed every single file on partition (except excluded, ofcourse), i can't find some of those files in backup.tgz (/vmlinuz...), so i would like to know if they are present or not? Secondly, could anyone tell which system files & directories are irrelevant for backup, so i could, even without them, restore my system in previous state? I hope I'm not asking too much
I'm very glad it worked--at least the exclusion part. I was just about to post about the order of the options, when I saw your post quoted above where you'd got it right.
As for asking too much, I don't think a user can ever ask too much. A system should do what the user wants. I know this is heresy to some "gurus," but for us more down-to-earth users, I think it's perfectly reasonable to want computers to do things for us, and not vice-versa.
Anyway.
As far as I can see, your /vmlinuz should be there. It's not a special file that tar doesn't know how to handle... That puzzles me. I'll do a little experimenting and see what I can find out.
What directories/files might as well be excluded is a subject of debate. Most seem to feel the /var and /tmp directories should always be excluded, as well as /proc. There is a lot of debate (to judge from what I've seen) over /sys. My own feeling is--if you have lots of disk space or media space to use, why not just back everything up anyway? You don't have to restore it all.
A utility such as partimage which creates a supposedly (!) faithful copy of a partition, will back up every last thing there, and partimage is used for restoration by a lot of people, including myself at least once. I feel uneasy using partimage, though; it's poorly presented to the user and that makes me have doubts, even though many, many swear by it.
I'd say leave out /proc, /var, and /tmp and keep everything else. Or leave them in.
Is it possible to use the backup file over and over and only it backs up files that are new or different? (I apologize if this was covered in the thread. I'm at work and didn't get a chance to read the whole thread.)
"smooth as seelk"
Bookmarks