From: "Dave Nebinger" <dnebinger@joat.com>
To: <gentoo-user@lists.gentoo.org>
Cc: <news@sea.gmane.org>
Subject: RE: [gentoo-user] Re: rsync internal mirror configuration
Date: Tue, 12 Jul 2005 09:06:09 -0400 [thread overview]
Message-ID: <002201c586e2$7930cf60$5f01010a@jnetlab.lcl> (raw)
In-Reply-To: <loom.20050712T034425-176@post.gmane.org>
> OK on the local rsync server I added this to automate the daily
> task of rsync(ing)
> # Rsync entries
> #
> 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:
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
cornholio ~ #
The if/then logic is needed because eix expects a <version>/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.
> 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:
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
cornholio ~ #
> 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.
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.
> 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.
> 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.
I tend to stagger my system emerges because I use distcc. The individual
boxes have a smaller time impact handling the package recompiles.
--
gentoo-user@gentoo.org mailing list
next prev parent reply other threads:[~2005-07-12 13:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-11 18:18 [gentoo-user] rsync internal mirror configuration James
2005-07-11 18:37 ` Dave Nebinger
2005-07-12 2:42 ` [gentoo-user] " James
2005-07-12 6:51 ` A. Khattri
2005-07-12 15:16 ` James
2005-07-12 13:06 ` Dave Nebinger [this message]
2005-07-12 15:03 ` James
2005-07-12 15:29 ` Dave Nebinger
2005-07-12 16:03 ` James
2005-07-12 16:36 ` Dave Nebinger
2005-07-12 19:24 ` James
2005-07-12 19:47 ` Dave Nebinger
2005-07-13 14:35 ` James
2005-07-13 14:55 ` Dave Nebinger
2005-07-13 16:03 ` James
2005-07-13 14:51 ` James
2005-07-13 15:12 ` Dave Nebinger
2005-07-13 16:16 ` James
2005-07-13 17:54 ` A. Khattri
2005-07-13 20:35 ` James
-- strict thread matches above, loose matches on Subject: below --
2005-07-12 13:09 Dave Nebinger
2005-07-12 15:04 ` James
2005-07-12 15:36 ` Dave Nebinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002201c586e2$7930cf60$5f01010a@jnetlab.lcl' \
--to=dnebinger@joat.com \
--cc=gentoo-user@lists.gentoo.org \
--cc=news@sea.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox