From owner-freebsd-questions@FreeBSD.ORG Mon Jun 25 19:23:11 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 644F416A469 for ; Mon, 25 Jun 2007 19:23:11 +0000 (UTC) (envelope-from freebsd@dfwlp.com) Received: from pollux.dfwlp.com (rrcs-64-183-212-244.sw.biz.rr.com [64.183.212.244]) by mx1.freebsd.org (Postfix) with ESMTP id 1891613C4B7 for ; Mon, 25 Jun 2007 19:23:11 +0000 (UTC) (envelope-from freebsd@dfwlp.com) Received: from athena.dfwlp.com (athena.dfwlp.com [192.168.125.83]) (authenticated bits=0) by pollux.dfwlp.com (8.13.8/8.13.8) with ESMTP id l5PJN8n9077972 for ; Mon, 25 Jun 2007 14:23:08 -0500 (CDT) (envelope-from freebsd@dfwlp.com) From: Jonathan Horne To: freebsd-questions@freebsd.org Date: Mon, 25 Jun 2007 14:23:07 -0500 User-Agent: KMail/1.9.6 References: <467FD67B.9070604@oregnier.net> <46800849.5040402@slightlystrange.org> In-Reply-To: <46800849.5040402@slightlystrange.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706251423.08172.freebsd@dfwlp.com> X-Spam-Status: No, score=-3.8 required=3.6 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on pollux.dfwlp.com Subject: Re: script to update my ports tree X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2007 19:23:11 -0000 On Monday 25 June 2007 13:24:09 Daniel Bye wrote: > Olivier Regnier wrote: > > Hi everyone, > > > > I made a shell script in /etc/periodic/daily/610.update-ports-tree and > > in my /etc/periodic.conf, this line : > > daily_update_ports_tree_enable="YES". > > > > The problem is simple, my script doesn't start at all. > > > > Can you help me please ? > > > > Thank you :) > > There is a syntax error in the script - you have missed the ;; from the > end of the first case statement. Try putting that in and see what > happens. You need something like this, or the script will just fall off > the last case statement, which does nothing: > > case $var in > yes) > do stuff here > ;; > *) ;; > esac > > > Also, you can simplify the script somewhat - you don't need to jump > through all those hoops with sed and awk to create a supfile on the fly > - just put this in your /etc/make.conf file, which does the same as your > selectserver() function: > > SUP_UPDATE= yes > SUP= /usr/bin/csup > SUPFLAGS= -g > SUPHOST= `/usr/local/bin/fastest_cvsup -Qc uk,fr,nl` > SUPFILE= /etc/cvsup/system > > The -Q option to fastest_cvsup returns just the hostname of the fastest > server, so no need to set up an enormous pipeline of tools. Alter the > rest of the script to call 'make update' from /usr/ports, and you're done. > > Alternatively, you can use portsnap(8) instead - it automatically > selects one of the available mirrors and uses it. However, you will need > to do a bit of work to set this up - remove your ports tree (no, > seriously - follow along, this is good), then run: > > # portsnap fetch extract > > Now your script just needs to call > > # portsnap fetch update > > and that's it. This has the advantage that you don't need to cd to > /usr/ports for it to work. > > HTH, one way or another... > > Dan > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" easiest way, is to add this to /etc/crontab 15 15 * * * root portsnap cron update > /dev/null 2>&1 cheers, -- Jonathan Horne http://dfwlpiki.dfwlp.org freebsd@dfwlp.com