|
perkiset
|
 |
« on: September 10, 2009, 10:26:16 AM » |
|
I've tried this a bazillion ways and always just give up because I've got to get it done.
I've tried: tar -czvf -x *.flv ../mytarball.tar.gz * tar -c -z -v -f -x *.flv ../mytarball.tar.gz * tar -c -z -v -f -x=*.flv ../mytarball.tar.gz * tar -c -z -v -f --exclude=*.flv ../mytarball.tar.gz * tar -c -z -v -f --exclude-file=./aFileWithPatterns ../mytarball.tar.gz *
... and none of them do the proper exclusions. What I want to do is exclude tarballs, flvs and isos from my tarball.
Any help appreciated. Motrin also.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
nutballs
|
 |
« Reply #1 on: September 10, 2009, 11:47:49 AM » |
|
|
|
|
|
|
Logged
|
I could eat a bowl of Alphabet Soup and shit a better argument than that.
|
|
|
|
cdc
|
 |
« Reply #2 on: September 10, 2009, 02:10:14 PM » |
|
Kind of a hack but could you use find and | the results to tar cf?
|
|
|
|
|
Logged
|
Will code for food.
|
|
|
|
perkiset
|
 |
« Reply #3 on: September 10, 2009, 02:24:06 PM » |
|
Hmmm... going positive rather than exclude... perhaps. Do you know what the format is if I want to lots of suffixes or even whole directories? This is a backup application, so I want to include all my MySQL files (from over there) images, pdfs, php etc from (from another dir) etc... don't know what that'd look like.
My goal here is to quit with my gigantic tarball creation and download... I have dozens of hundreds of large flvs that I don't need to back up, ISOs, old tarballs etc that I don't want to eliminate but don't want to backup. I want to do it more often and it'll need to be much lighter to do so...
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
cdc
|
 |
« Reply #4 on: September 10, 2009, 02:33:33 PM » |
|
find . -not -name *.flv -not -name *.tar
should work, no?
|
|
|
|
|
Logged
|
Will code for food.
|
|
|
|
perkiset
|
 |
« Reply #5 on: September 10, 2009, 04:40:28 PM » |
|
Hmmm... an interesting notion. With a inclusive, rather than exclusive notion it'd be easier for me to potentially grab everything that I want to archive into one biggie, rather than several archives. Thanks C, gonna give that a think. j'Preciate 
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
kurdt
|
 |
« Reply #6 on: September 10, 2009, 05:05:49 PM » |
|
And you tested rm *.tar* also? That excludes..
|
|
|
|
|
Logged
|
I met god and he had nothing to say to me.
|
|
|
|
perkiset
|
 |
« Reply #7 on: September 10, 2009, 05:08:56 PM » |
|
Grrr.
Need some more helps perhaps. I have find doing exactly what I want, and I like what you've proposed C. It gives me a nice list of everything I want to backup in a text file, so that I can preview it before it goes - this is handier than getting half way through a tarball and realizing I've got something I don't want.
Now I'm having trouble telling tar what to *include*. Sites all say -I or --include or --include-from and such, but those options do not seem to exist in this version of tar (version 1.5.1, FC 6 on this box, no listing in the man page either) so I've seen some things like cat list.txt|xargs tar.cf thearchive.tar ... and tried them - but it ignored the cat'd list and just started archiving everything.
Sorry for the lean meng, thanks for the help.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
perkiset
|
 |
« Reply #8 on: September 10, 2009, 05:09:40 PM » |
|
And you tested rm *.tar* also? That excludes..
Heh... excludes permanently you mean  Don't want to get rid of stuff, just to keep them out of this oft-run backup.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
perkiset
|
 |
« Reply #9 on: September 10, 2009, 05:13:40 PM » |
|
What I'm working with now is a bash script with lines like this:
find /www/sites/aproject -not -name *.flv -not -name *.tar* -not -name *.iso -not -name *OLD* -not -name *DS_Store* >> aproject.todo
where aproject is a website and all resources, then another line that includes it's database files from mysql and then another that includes it's sitefile from my Apache configuration (I have all my sites included into the httpd.conf rather than actually in them). I get a very attractive list that, having run from the root, includes the entire file page of everything I want to grab to keep (aproject)'s associated files.
So What I'd like to do is just feed tar with these files, then I could either have a project file for just (aproject) or one master backup file should I choose - I'll probably go with distinct files.
I don't understand the usage of cat, have tried it in front and in back of the tar command with < and | and such - I'm CERTAIN that I'm just a luddite and doing it wrong.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
cdc
|
 |
« Reply #10 on: September 11, 2009, 06:09:03 AM » |
|
One thing you could do is read in the entire file line by line, build the tar command, and execute it. It's not pretty but it should work.
|
|
|
|
|
Logged
|
Will code for food.
|
|
|
|
kurdt
|
 |
« Reply #11 on: September 11, 2009, 06:18:07 AM » |
|
Or you could just press ctrl down and pick only the files you want to compress... wait.. I think I have one more.. Or you could mv *.tar* to another hd while you compress other files.
|
|
|
|
|
Logged
|
I met god and he had nothing to say to me.
|
|
|
|
vsloathe
|
 |
« Reply #12 on: September 11, 2009, 07:23:13 AM » |
|
Sec, I will bang something out. Sorry Perks if I'd caught this last night I'd have written you a simple one-liner. You guys are WAY wrapped around the axle here. find /www/sites/aproject -not -name *.flv -not -name *.tar* -not -name *.iso -not -name *OLD* -not -name *DS_Store* | xargs tar -czvf
Haven't tested it. Would be VERY surprised if it didn't do exactly what you need. Write a log with >> like you were doing, but I would not append the raw list of files like that or you're just going to keep duplicating stuff.
|
|
|
|
|
Logged
|
hai
|
|
|
|
vsloathe
|
 |
« Reply #13 on: September 11, 2009, 07:36:02 AM » |
|
Here's one from scratch that should be faster (find is a BEAR on its own): find /www/sites/aproject -not -regex '/\.flv.*?|\.tar.*?|\.iso.*?|.*?OLD.*?|.*?DS\_Store.*?/' | xargs tar -czvf
|
|
|
|
|
Logged
|
hai
|
|
|
|
perkiset
|
 |
« Reply #14 on: September 11, 2009, 07:49:52 AM » |
|
Thanks guys ... and hiya V - I was wondering if you were just giving me the silent treatment for being an idiot  I worked through most of it last night. First issue, the tar executable was not current & didn't have files-from - downloaded the newest GNU tar, compiled and installed. Problem was it was including every single file, regardless of the files-from instruction (or so I thought). Then finally got the idea that the find command would have found dirs as well - in other words, calling out a dir it was recursing the dir and collecting everything it saw, even though I had not specifically called out the files. So I added no dir recursion to the command line. Then I was getting an error at the end of it which was bollocksing the tarball, which I gathered was a bad read of a sym link - add ignore bad reads and it's all good. So my goals today are to write up the construction portion (which builds the todo lists for all the sites that are affected by this) and the downloader. And also to understand xargs and the pipe better, which you use here are it looks understandable, but I'd love it if you'd just give a light overview of how and where piping and various *nix commands can be combined on a line like this to create complex instructions. thanks again lads 
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|