From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1DsMSF-0000DG-HU for garchives@archives.gentoo.org; Tue, 12 Jul 2005 15:13:51 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j6CFAvmw001030; Tue, 12 Jul 2005 15:10:57 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j6CF74Fl000517 for ; Tue, 12 Jul 2005 15:07:04 GMT Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by smtp.gentoo.org with esmtp (Exim 4.43) id 1DsMMU-0004Z3-Gl for gentoo-user@lists.gentoo.org; Tue, 12 Jul 2005 15:07:54 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DsMKP-0000Cq-QS for gentoo-user@gentoo.org; Tue, 12 Jul 2005 17:05:45 +0200 Received: from www.buffer.net ([24.73.161.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Jul 2005 17:05:45 +0200 Received: from wireless by www.buffer.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Jul 2005 17:05:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: James Subject: [gentoo-user] Re: rsync internal mirror configuration Date: Tue, 12 Jul 2005 15:03:57 +0000 (UTC) Message-ID: References: <002201c586e2$7930cf60$5f01010a@jnetlab.lcl> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 24.73.161.102 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050517) Sender: news X-Archives-Salt: 507056e8-e903-4274-86e1-f6a19f9f28b5 X-Archives-Hash: 7a26efea6325235972a795789a09a26f Dave Nebinger joat.com> writes: > > OK on the local rsync server I added this to automate the daily > > 30 1 * * * root emerge sync > Unless you want to receive the daily email full of all kinds of funky > characters, I'd redirect the output from emerge to a file. On my boxen I > call 'dailysync.sh' from cron. The script has this: OK but can't I do that with a simple mode to the /etc/crontab ?: 30 1 * * * root emerge sync 2>&1 ? > cornholio ~ # cat bin/dailysync.sh > #!/bin/sh > # > # sync.sh: Script to handle the portage syncing. > emerge --sync 1>>/var/log/autosync.log 2>&1 > # Update eix and edb... > if [ -e /usr/portage/profiles/default-linux/x86/2005.0/make.defaults ] > then > echo Not recreating make.defaults, it exists... >>/var/log/autosync.log > else > echo Recreating make.defaults... >>/var/log/autosync.log > ln -sf ../make.defaults > /usr/portage/profiles/default-linux/x86/2005.0/make.defaults > 1>>/var/log/autosync.log 2>&1 > fi > eix -u 1>>/var/log/autosync.log 2>&1 > eupdatedb 1>>/var/log/autosync.log 2>&1 OK, I can try this script. I guess eix is an ebuild index & searching tool, that I need to read up on... This script is for the internal rsync/replicator server? > The if/then logic is needed because eix expects a /make.defaults > file, but the make.defaults has been pushed up one directory level. The > emerge --sync wipes the file out so I have to recreate it before updating > eix. And the output from the script goes to a log file rather than > stdout/stderr (so when run via cron no email is generated). > > OK, now I use document (C) to create the proxy entry on each client: > > Editing File: /etc/env.d/99local to look like this > > http_proxy="192.168.2.9:8080" > > instead of this > > http_proxy="proxy.server.com:8080" > > I check it on the client by issuing "echo $http_proxy" > > which give the correct results: > > 192.168.2.9:8080 > > So far so good??? > Hmm, the documentation might have changed since I did my setup. My internal > boxes have 'http_proxy=http://192.168.0.1:8084' directly in the make.conf > file; I didn't make any changes to /etc/conf.d/local.start for the http > proxy. OK, the port has changed. What's the deal about that? > > and last run this daily on the server to keep it current? > > emerge -uDva world && repcacheman > Well if you have the time and inclination you can do it daily. Once you get > into maintaining the system you'll realize that this kind of attention to > the box is frequently overkill - a working box is a working box and there is > no need to fix what isn't broken. > Rather than do this on a daily basis I generate a daily email of packages to > be updated; if I see one I feel is critical I'll deal with the update > otherwise I'll let the system go for awhile. The script I use for this is: OK, monthly on a manual basis. I'll try your script/email approach. > cornholio ~ # cat bin/updatereport.sh > #!/bin/sh > # updatereport.sh: Script to send an update report to root. > # Remove the old report file. > if [ -e /var/log/update.report ] ; then > /bin/rm -f /var/log/update.report > fi > if [ -e /var/log/update.rpt.txt ] ; then > /bin/rm -f /var/log/update.rpt.txt > fi > # Run the command to generate the output file. > emerge --pretend --update --deep world 1>/var/log/update.report > # Put a standard header at the top of the text file. > echo "Current gentoo update report." > /var/log/update.rpt.txt > echo "" >> /var/log/update.rpt.txt > date >> /var/log/update.rpt.txt > echo "" >> /var/log/update.rpt.txt > # Extract a clean text file > strings /var/log/update.report >> /var/log/update.rpt.txt > # Mail the clean text file. > mail -s "Cornholio Portage Update Report" root < /var/log/update.rpt.txt OK thanks for the script. I'll have to study it, test it and let you know how it goes... > > Anything I missed? > Well sure. The part I should have mentioned is that if your systems are all > similar in that they have the same hardware and same use flags, package > installs, etc., then you might want to have one system build binary packages > for distribution to the internal systems. That way you only suffer the > build once. In the future I'll be distributing binaries to lots of old pI and pII systems, so that kind of automation will have to wait. > Personnaly I've got different architectures (PIII, P4, and AMD) mixed in > and, as each system has a different purpose they typically don't have > similar use flags or package installations, so a binary package distribution > doesn't work for me. ditto. > > Surely parts of all (4) documents belong in one master howto? > I'm sure it could but there's probably folks on the other side of the fence > that only want a local rsync mirror or a local portage download cache and > not both. Well the simple cases are easy. What I need, including your scripts is to be in a single document. I'll write something, and you can look it over. That helps me fully understand what everything does, and provides a nice little document. I tend to 'dumb down' documents, so they are easy to understand.... I also include more background material so novices and seasoned persons can use them. > > Is there a script to update workstation systems, automatically, > > say 10 minutes after booting? How best to do this? > Sure. Generate a script that sleeps for 10 minutes then kicks off the > emerge process. Call the script from /etc/conf.d/local.start (be sure to > include the & to spawn it in the background) and you're golden. > However, you need to consider if this is something that you really want to > do. Automated updates are frowned upon by folks on the list. Agreed. But I intend to set up a test-quarrantine system that is fully automated, and if all goes well for (1) 24-hour period, then push the updates to a bunch of PI and PII systems for a bunch of kids (hoodlums.... some of which are mine.) Thanks for the help and scripts... James -- gentoo-user@gentoo.org mailing list