From owner-freebsd-questions@FreeBSD.ORG Sat Apr 10 13:06:15 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E54D16A4CE for ; Sat, 10 Apr 2004 13:06:15 -0700 (PDT) Received: from smtp.owt.com (smtp.owt.com [204.118.6.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id B07CE43D1D for ; Sat, 10 Apr 2004 13:06:14 -0700 (PDT) (envelope-from kstewart@owt.com) Received: from [207.41.94.233] (owt-207-41-94-233.owt.com [207.41.94.233]) by smtp.owt.com (8.12.8/8.12.8) with ESMTP id i3AK688a003191; Sat, 10 Apr 2004 13:06:08 -0700 From: Kent Stewart To: Chuck Swiger Date: Sat, 10 Apr 2004 13:06:13 -0700 User-Agent: KMail/1.6.1 References: <4076527F.1060902@users.sourceforge.net> <200404100833.34425.kstewart@owt.com> <40784581.7080306@mac.com> In-Reply-To: <40784581.7080306@mac.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404101306.13154.kstewart@owt.com> cc: freebsd-questions@freebsd.org Subject: Re: Portupgrade problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2004 20:06:15 -0000 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