LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-07-2005, 06:11 PM   #1
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
tar problems [SOLVED]


Hi
I'm trying to do a backup of my home dir without my mp3 dir.

tar czf test.tar.gz /home/user --exlude=/home/user/mp3

and the output is that it can't find "--exclude=/home/mp3" but all my mp3s end up in the archive.

Any hints? Supposed to work, I'm pretty sure I've done it this way on other machines.

************************

ok, I got it by doing it this way

tar -cvz --exclude=/home/user/mp3 -f test.tart.gz /home/user

Last edited by yanik; 09-07-2005 at 06:18 PM.
 
Old 09-08-2005, 10:50 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Tar is very picky about its order of arguments.
 
Old 09-08-2005, 11:18 AM   #3
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
This is a script I used to use for backing up home
#!/bin/bash
SDIR="/home/"
TDIR="/var/backups/"
OUTF=home-$(date +%d%m%Y).tgz
tar \
--exclude /home/markus/.kde/share/thumbnails \
--exclude /home/markus/.kde/share/cache \
-zcvf $TDIR$OUTF $SDIR
 
Old 09-08-2005, 11:20 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Very nice, though I'd also exclude my browser's cached pages.
 
Old 09-08-2005, 11:34 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
tar simply works as expected. tar is used like this:
tar options filenames

You tried to put an option after a filename, so it got evaluated as a filename.
Code:
tar czf test.tar.gz --exlude=/home/user/mp3 /home/user
would probably do what you want.

Yves.
 
Old 09-08-2005, 01:55 PM   #6
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Quote:
Originally posted by Matir
Very nice, though I'd also exclude my browser's cached pages.
Good point, thanks, but like I said, I used to use it. Now I just boot a livecd ~twice a month and use partimage to make images from hda to an extra partition on hdb and vice versa. Even burn them to dvdrw once in a while although I seriously doubt if both hds will bork simultaneously. OTOH, there's always mr. Murphy.
 
Old 09-08-2005, 01:58 PM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Well, what if your power lines get hit by lightning? Or your computer is stolen? Or your house gets flooded? Doesn't take a hard drive crash to destroy your data. Good for you with the DVDs.
 
Old 09-08-2005, 02:13 PM   #8
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Well, what if your power lines get hit by lightning?
Hmm, got me there. Note to self, fix the ups that broke but saved computer.
Or your computer is stolen?
It's a celeron1000 desktop guarded by two fierce labradors. The last time a neighbour came in when we forgot the door wide open, the dogs threatened him with cruel looking toys.
Or your house gets flooded?
Building sitting ~20 m above sea level
Doesn't take a hard drive crash to destroy your data. Good for you with the DVDs.
Yup, I really should burn them more often. I just sort of try to estimate when I've done enough work/tuning_install that I don't want to lose it.
 
Old 09-08-2005, 02:28 PM   #9
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
I'm not criticizing your mechanism, and others may have different risks. I'm sure some businesses in New Orleans are wishing they had better backup systems. (Not trying to be cruel about it, just calling it like I see it) There's always fires, catastrophic power supply failures and the like. I have a small fire-resistant lockbox I store backup DVDs in. Nothing is guaranteed, you just have to do your best.
 
Old 09-08-2005, 03:18 PM   #10
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Nonono, I didn't take it as criticism. I was at least partly joking about the dogs that wouldn't hurt anything bigger than a fly as I take it the original question has already been answered and the poster would perhaps not mind the thread going off topic. But the fireproof box is actually a very good idea. Going to look into buying one. That, or a reinforced rifle cabinet where I could also store the dvds, would need one soon anyway.
You're right about nothing being guaranteed as well, I still remember vividly when I meant to "rm -rf /some/dir/*" as root and hit an extra space by mistake: "rm -rf /some/dir /*". After a while I noticed the hd still crunching and by the time I got suspicious and hit ctrl-c it was time to restore the install. Didn't take a lightning or anything but me
 
Old 09-08-2005, 03:21 PM   #11
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
LOL. I still need to find an effective way to backup my 80 G of data. Right now I just rsync my homedir to another machine and make DVD backups once in a while. I guess I'll just reinstall if/when the case comes. I *DO* have a copy of a lot of my config files.
 
Old 09-08-2005, 04:07 PM   #12
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
imo an usb/firewire hd would be perfect for that data amount. You could even store it in the lockbox. You can buy a huge bunch of dvds for the price though, but it would be more convenient.
 
Old 09-08-2005, 04:46 PM   #13
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Yeah, I just need to get myself one of those... ~$50 for the enclosure, $70 for the hard drive... not too much, but being a college student, still quite significant.
 
Old 09-08-2005, 05:11 PM   #14
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
A bit cheaper would be an 5.25" ide enclosure, costs ~10-15 and would be just as usable for taking local backups. The cheapest option is of course to take out one of the pci card covers and leave a power&ide cable hanging out
Still, the hd price is what matters, and nope, can't get around that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
installation problems with libxml2-2.2.66.tar.gz and libxml2-devel2-2.6.20-3.tar.gz g-string 3 Linux - Software 6 11-24-2005 12:39 PM
tar problems jecvdv Linux - Newbie 2 01-23-2005 05:20 PM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration