Linux - SoftwareThis 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.
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.
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.
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...
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
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)
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
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.
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
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?
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?
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.
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?
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.