This is a discussion on Selective Copy? within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> Hey! OK, here's what I'd like to do. I'd like to cp my /usr/portage directory over to another computer ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hey! OK, here's what I'd like to do. I'd like to cp my /usr/portage directory over to another computer (essentially making a snapshot of however current it is at the time). *HOWEVER*, I don't want to copy over my packages or distfiles dir. The all the packages there are for a different processor (everything there is for a Pentium 4, the target machine is a P-MMX), and the distfiles would waste far too much space to copy the whole thing over (I'm just going to NFS mount it). Now I know the easy way is to mv the packages and distfiles out of the portage dir and copy the remaing stuff to the target machine, but, is there a way to tell cp to exclude certain directories? I hope I explained this well enough for someone to make sense of... Thanx! |
| |||
| So anyway, it was like, 09:58 CET Jan 30 2004, you know? Oh, and, yeah, Xanadu was all like, "Dude, > Hey! Yo. > I'd like to cp my /usr/portage directory over to another computer > (essentially making a snapshot of however current it is at the > time). *HOWEVER*, I don't want to copy over my packages or distfiles > dir. The all the packages there are for a different processor > (everything there is for a Pentium 4, the target machine is a > P-MMX), and the distfiles would waste far too much space to copy the > whole thing over (I'm just going to NFS mount it). Why don't you just nfs mount /usr/portage as well? Here's what I do, I have three gentoo boxen which all share the same portage structure. One of them is a file server, so I found it fitting to appoint it master and let it export /usr/portage and distfiles to the other two. /usr/portage is mounted read-only, and the file server rsyncs on a regular basis by means of cron. The distfiles dir is writeable from each box (one major catch here, make sure you don't start two identical emerges at the same time since you'll end up with a b0rked fetch that way). If you have packages stored, I think you should probably move the package dir on each box out of the /usr/portage structure. Look up "PKGDIR" (and perhaps even "DISTDIR") in /etc/make.conf and see if that gives you any ideas. > Now I know the easy way is to mv the packages and distfiles out of > the portage dir and copy the remaing stuff to the target machine, > but, is there a way to tell cp to exclude certain directories? That's not the easy way. You want to move this to another box, not just copy it to another place on the original one? I'd try something like $ cd /usr $ tar -cvf - --exclude=distfiles portage | ssh foo "cd /usr && tar -xvf -" to copy "/usr/portage" to the box "foo" without bringing the subdirectory "distfiles" along for the ride. Tweak as desired. hth. -- Time flies like an arrow, fruit flies like a banana. Perth ---> * 10:02:14 up 5 days, 17:38, 2 users, load average: 2.16, 2.13, 2.10 $ cat /dev/bollocks Registered Linux user #261729 streamline frictionless web-readiness |
| |||
| So anyway, it was like, 10:19 CET Jan 30 2004, you know? Oh, and, yeah, I was all like, "Whoa, dude, > I'd try something like > > $ cd /usr > $ tar -cvf - --exclude=distfiles portage | ssh foo "cd /usr && tar -xvf -" > > to copy "/usr/portage" to the box "foo" without bringing the > subdirectory "distfiles" along for the ride. Tweak as desired. One tweak might be to correct the use of too many "v" flags. Sorry. -- Time flies like an arrow, fruit flies like a banana. Perth ---> * 10:34:49 up 5 days, 18:10, 2 users, load average: 2.04, 2.08, 2.07 $ cat /dev/bollocks Registered Linux user #261729 engage interactive markets |
| |||
| Johan Lindquist wrote: > So anyway, it was like, 10:19 CET Jan 30 2004, you know? Oh, and, yeah, > I was all like, "Whoa, dude, > > >>I'd try something like >> >>$ cd /usr >>$ tar -cvf - --exclude=distfiles portage | ssh foo "cd /usr && tar -xvf -" >> >>to copy "/usr/portage" to the box "foo" without bringing the >>subdirectory "distfiles" along for the ride. Tweak as desired. > > > One tweak might be to correct the use of too many "v" flags. Sorry. > Good tip there, I suspected you could do something like that with ssh. Now I know. -- Ben M. ---------------- What are Software Patents for? To protect the small enterprise from bigger companies. What do Software Patents do? In its current form, they protect only companies with big legal departments as they: a.) Patent everything no matter how general b.) Sue everybody. Even if the patent can be argued invalid, small companies can ill-afford the typical $500k cost of a law-suit (not to mention years of harassment). Don't let them take away your right to program whatever you like. Make a stand on Software Patents before its too late. Read about the ongoing battle at http://swpat.ffii.org/ ---------------- |
| |||
| Johan Lindquist enlightened us with: > One tweak might be to correct the use of too many "v" flags. Sorry. Another tweak might be the inclusion of the 'z' option for the two tars. That way, you'll get on the fly compression as well, in case the network bandwidth is the bottleneck. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? |
| |||
| So anyway, it was like, 14:07 CET Jan 30 2004, you know? Oh, and, yeah, Sybren Stuvel was all like, "Dude, > Johan Lindquist enlightened us with: >> One tweak might be to correct the use of too many "v" flags. Sorry. > > Another tweak might be the inclusion of the 'z' option for the two > tars. That way, you'll get on the fly compression as well, in case > the network bandwidth is the bottleneck. Would that be redundant, given (or preferable to) ssh compression? Also, which one is considered faster, bzip (j) or gzip (z)? In the case of a normal, wired, home user network running 100mbit full duplex, this is probably academic since it'll be quicker to just skip compression completely, but now you have me wondering about this. -- Time flies like an arrow, fruit flies like a banana. Perth ---> * 14:15:44 up 5 days, 21:51, 2 users, load average: 2.05, 2.04, 2.00 $ cat /dev/bollocks Registered Linux user #261729 repurpose B2B interfaces |
| |||
| Johan Lindquist enlightened us with: > Would that be redundant, given (or preferable to) ssh compression? I'm not sure about which compression ssh uses. If CPU usage isn't an issue, you can try both ;-) > Also, which one is considered faster, bzip (j) or gzip (z)? gzip (de)compresses faster, bzip2 compresses a lot better. Your choise of compression boils down to the bottleneck question. If your CPU is the bottleneck, use gzip. Otherwise, use bzip2. > In the case of a normal, wired, home user network running 100mbit full > duplex, this is probably academic since it'll be quicker to just skip > compression completely, but now you have me wondering about this. Compression can save a lot of time, especially the next time you do this and you won't have to discuss about it on Usenet ;-) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? |
| |||
| So anyway, it was like, 14:37 CET Jan 30 2004, you know? Oh, and, yeah, Sybren Stuvel was all like, "Dude, > Johan Lindquist enlightened us with: >> Would that be redundant, given (or preferable to) ssh compression? > > I'm not sure about which compression ssh uses. If CPU usage isn't an > issue, you can try both ;-) Well, the entire discussion would be moot if cpu power was infinite, wouldn't it? compression starts to save time, given different bandwidth and cpu resources. A slow computer (at either end) will at some point have a negative impact on the speed if compression is used, even if bandwidth is somewhat limited. >> Also, which one is considered faster, bzip (j) or gzip (z)? > > gzip (de)compresses faster, bzip2 compresses a lot better. Your > choise of compression boils down to the bottleneck question. If your > CPU is the bottleneck, use gzip. Otherwise, use bzip2. This is certainly interesting to consider. >> In the case of a normal, wired, home user network running 100mbit >> full duplex, this is probably academic since it'll be quicker to >> just skip compression completely, but now you have me wondering >> about this. > > Compression can save a lot of time, especially the next time you do > this and you won't have to discuss about it on Usenet ;-) I'm assuming you mean "experiment", and I think I will. -- Time flies like an arrow, fruit flies like a banana. Perth ---> * 14:44:49 up 5 days, 22:20, 2 users, load average: 2.00, 2.03, 2.00 $ cat /dev/bollocks Registered Linux user #261729 mesh magnetic architectures |
| |||
| Johan Lindquist enlightened us with: > Well, the entire discussion would be moot if cpu power was infinite, > wouldn't it? Yep I remember the days when I had a 486 with a really slow harddisk. Using some drive compression util, I was actually speeding up disk access, because less had to be read/written. > I'm assuming you mean "experiment", and I think I will. Good! Only experimentation can give you a definite answer here. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? |
| ||||
| On Fri, 30 Jan 2004 14:02:54 +0000, Sybren Stuvel wrote: > Johan Lindquist enlightened us with: >> Well, the entire discussion would be moot if cpu power was infinite, >> wouldn't it? > > Yep > > I remember the days when I had a 486 with a really slow harddisk. Using > some drive compression util, I was actually speeding up disk access, > because less had to be read/written. > >> I'm assuming you mean "experiment", and I think I will. > > Good! Only experimentation can give you a definite answer here. > > Sybren Well, just to jump in here real quick... :-) It is a "normal" home LAN we're talking about here. 100Mbits Full Duplex. This machine is very peppy (PIV-2.4GHz, 1G of RIMMs). The target machine is pretty slow (P200-OD, 96M RAM). I tried the NFS idea of mounting /usr/portage and that whole thing. I have problems that I just don't see what's wrong. Here's my Exports on this box: /usr/portage/ *(rw,async,no_root_squash) /usr/portage/distfiles *(rw,async,no_root_squash) I know, I know that's not very secure, but it's a home LAN that only I know root's passwd for (that and I'm still learning a lot about NFS...). distfiles can mount fine remotely, but portage itself gives me a permission denied error. As you can see, they are being exported exactly the same, and the dir permissions on them are exactly the same: drwxr-xr-x 113 root root 4096 Jan 28 08:35 portage and drwxr-xr-x 3 root root 106496 Jan 30 07:44 distfiles Any ideas? |