Date: Sat, 10 Apr 2004 13:06:13 -0700 From: Kent Stewart <kstewart@owt.com> To: Chuck Swiger <cswiger@mac.com> Cc: freebsd-questions@freebsd.org Subject: Re: Portupgrade problem Message-ID: <200404101306.13154.kstewart@owt.com> In-Reply-To: <40784581.7080306@mac.com> References: <4076527F.1060902@users.sourceforge.net> <200404100833.34425.kstewart@owt.com> <40784581.7080306@mac.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404101306.13154.kstewart>