LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-02-2006, 10:11 PM   #1
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 45
tar problems, trying to pipe through split


I'm using the command
Code:
 tar cvpf - / --exclude=/home/jake/backup --exclude=/proc --exclude=/mnt | split -b 1000m - linux
in order to back up my HD, so I can copy it to a bigger one. The thing is, tar isn't excluding the directories I want it to. My assumption is that I put the exclude arguments in the wrong spot. When I run this, it's in /home/jake/backup(a NFS mounted drive, hence the splitting), because otherwise it just writes the split files directly to whatever directory I'm in.

Could someone point me in the right direction?
 
Old 03-02-2006, 10:40 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,746

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
I could be mistaken, but if I understand tar correctly, --exclude=<filename> means exclude a file; not a directory.

You could try --exclude-from=<directory name> to see if that works.
 
Old 03-02-2006, 10:54 PM   #3
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
I though --exclude-from read from a file. Why wouldn't tar have the option to exlude a directory? That doesn't make much sense to me. I suppose I could try it...
 
Old 03-02-2006, 11:04 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
Almost everything in Linux is a file, including directories. I think you're right about the ordering. Does it work when you format it the following way?
Code:
tar -cv --exclude=/home/jake/backup --exclude=/proc --exclude=/mnt -f - / | split -b 1000m - linux
 
Old 03-03-2006, 09:05 AM   #5
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
what I ended up doing was mounting my root drive again, and just tarring that directory, it excludes /proc and /mnt, becuase I just mounted the root partition. I just realized that I forgot to exclude the backup directory. Bummer. Maybe I'll try the command above tonight(as I'm at school right now)
 
Old 03-04-2006, 11:23 AM   #6
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
actuallly, as the backup directory was mounted across a network, it didn't get mounted w/ the root parition. However, where I mounted the root partition(/floppy), it copied the directory it was mounted to as well. So now when I try and untar it, it's going to untar to /floppy/<everything that was previously in />. Is there any way to fix this? I was thinking, in /floppy
Code:
mv * ./../
Will that work?
 
Old 03-04-2006, 11:54 AM   #7
tvynr
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 143

Rep: Reputation: 15
I'm not sure why you're having trouble... --exclude works fine for me for tar version 1.14.

Regarding split: the last parameter is the prefix for the filenames. So if you wanted to explicitly specify the sequence /home/jake/backup/linux00 or whatever, you'd use:

Code:
... | split -b 1000m - /home/jake/backup/linux
and the numbers or letters would just be tacked onto the end.
 
Old 03-04-2006, 12:27 PM   #8
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
I don't know either. I actually ended up using the command
Code:
tar cvpf - floppy/ | split -b 1000m - /home/jake/backup/linux
where floppy is the drive mounted a second time. It worked for my linux parition, but when I tried the above command to tar up my windows partition(changed /home/jake/backup/linux to /home/jake/backup/windows), it quit on me, and it was almost done. It had like 1.6 GB more to go, and then it quit w/ the error
Code:
tar: Error exit delayed from previous errors
Suggestions?
 
Old 03-04-2006, 12:51 PM   #9
tvynr
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 143

Rep: Reputation: 15
Did tar list any previous errors? I've never seen that message by itself but, since you're using the verbose flag, it'd be hard to notice an error. Try routing standard out to /dev/null or not using the verbose flag?
 
Old 03-04-2006, 01:04 PM   #10
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
I thought the 'v' meant verbose? I didn't see any other errors, but then again, I wasn't watching every line that came across the screen. How do I route stdout to /dev/null when it's piped, the way it currently is?
 
Old 03-04-2006, 01:37 PM   #11
tvynr
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 143

Rep: Reputation: 15
The 'v' does mean verbose. It lists all of the names of the files as it processes them. If you have that on, a non-fatal error might be displayed and then float off of the top of the screen. Honestly, I'm not sure about the pipe... some kind of weird terminal magic makes that work.

If you leave the v flag out, it will still display the error messages but not the names of the files.
 
Old 03-04-2006, 03:41 PM   #12
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
oh, ok. That might be why I didn't see any error messages. I'll try it w/out the v flag, and see if I get anything. Shouldn't it have quit sooner though?
 
Old 03-04-2006, 04:01 PM   #13
tvynr
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 143

Rep: Reputation: 15
Not necessarily; it might be a non-fatal error, not serious enough to prevent making the archive. No examples pop to mind, I'm afraid.
 
Old 03-04-2006, 08:20 PM   #14
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Original Poster
Rep: Reputation: 45
Ok, I left the 'v' argument off, and I got the following results
Code:
tar: floppy/Documents and Settings/Jake 2/Application Data/Thunderbird/Profiles/wd91x161.default/Mail/mail.spiekerfamily.com/Inbox: File shrank by 11951762 bytes; padding with zeros
tar: Error exit delayed from previous errors
Could I just boot windows, remove that file, and have it work? It's an old file, I don't use windows for e-mail anymore, so it shouldn't make any difference right?
 
  


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
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 10:55 AM
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 05:40 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 11:39 AM
is it possible to get information from one bad split tar? eantoranz Linux - Software 1 03-30-2005 02:02 PM
Laptop Split Screen Problems after Display Suspends gendreau Linux - Laptop and Netbook 8 02-16-2004 07:13 PM


All times are GMT -5. The time now is 02:36 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration