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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-02-2006, 10:11 PM
|
#1
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Rep:
|
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?
|
|
|
03-02-2006, 10:40 PM
|
#2
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
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.
|
|
|
03-02-2006, 10:54 PM
|
#3
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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...
|
|
|
03-02-2006, 11:04 PM
|
#4
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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
|
|
|
03-03-2006, 09:05 AM
|
#5
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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)
|
|
|
03-04-2006, 11:23 AM
|
#6
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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
Will that work?
|
|
|
03-04-2006, 11:54 AM
|
#7
|
Member
Registered: Apr 2004
Distribution: Debian
Posts: 143
Rep:
|
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.
|
|
|
03-04-2006, 12:27 PM
|
#8
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
03-04-2006, 12:51 PM
|
#9
|
Member
Registered: Apr 2004
Distribution: Debian
Posts: 143
Rep:
|
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?
|
|
|
03-04-2006, 01:04 PM
|
#10
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
03-04-2006, 01:37 PM
|
#11
|
Member
Registered: Apr 2004
Distribution: Debian
Posts: 143
Rep:
|
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.
|
|
|
03-04-2006, 03:41 PM
|
#12
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
03-04-2006, 04:01 PM
|
#13
|
Member
Registered: Apr 2004
Distribution: Debian
Posts: 143
Rep:
|
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.
|
|
|
03-04-2006, 08:20 PM
|
#14
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
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?
|
|
|
All times are GMT -5. The time now is 03:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|