Portupgrade problem
Kent Stewart
kstewart at owt.com
Sat Apr 10 13:06:15 PDT 2004
On Saturday 10 April 2004 12:05 pm, Chuck Swiger wrote:
> Kent Stewart wrote:
> > On Saturday 10 April 2004 07:51 am, Andreas Davour wrote:
> >>Now I think I know how to do these things and after another upgrade
> >> I think I'm ready to at least do the cvsup part using cron.
> >
> > The hardest part of a cron job is finding that magic time after the
> > hour that never fails because your cvsup-mirror is over committed.
> > The mirrors always update on the hour and you have to wait at least
> > 10 minutes for the mirror to finish its cvsup. If you don't, you
> > are getting data from the mirror's previous update.
>
> Try something like:
>
> cvsup /etc/ports-supfile && portsdb -Uu
>
> ...as your cron job, or else put the commands into a script which you
> run from cron. The second command will run once the first command is
> finished, so you don't need to worry about the cvsup not finishing
> before doing the portsdb.
>
> [ I don't see a need to automaticly update the ports tree every hour
> from a cvsup mirror: doing so creates 24 cvsup sessions per day per
> machine. Isn't once a day frequent enough? :-) ]
I do it twice and cvsup my mirror about every 4 hours. My cronjob fires
off uports. It is
ruby# cat uports
#! /bin/sh
export
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin
cd /root/cvsup
cvsup -g -L 2 ports-supfile 2>&1 | tee /var/log/build/ports_cvsup.log
cd /var/log/build
# Now convert the log to html`
cvsuplog < ports_cvsup.log > ports-`date "+%Y%m%d-%H%M"`.html
# Now update the index pages.
cd /usr/ports
#
# make bzip2 backup and save 4 old ones for the days when make index
# is broken
#
rm INDEX.3.bz2
mv INDEX.2.bz2 INDEX.3.bz2
mv INDEX.1.bz2 INDEX.2.bz2
mv INDEX.0.bz2 INDEX.1.bz2
bzip2 -c INDEX > INDEX.0.bz2
#
# make new INDEX
#
make index 2>&1 | tee /var/log/build/make-index-`date
"+%Y%m%d-%H%M"`.log
portsdb -u
I could do the && thing but I want the log more than I care if it runs
or not. I could cut back on some of the tee but I see mail after it
runs.
Kent
--
Kent Stewart
Richland, WA
http://users.owt.com/kstewart/index.html
More information about the freebsd-questions
mailing list