From owner-freebsd-questions@FreeBSD.ORG Sun Feb 6 03:36:22 2005 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 984E816A4CE for ; Sun, 6 Feb 2005 03:36:22 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id D128D43D3F for ; Sun, 6 Feb 2005 03:36:21 +0000 (GMT) (envelope-from j65nko@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so573668wra for ; Sat, 05 Feb 2005 19:36:21 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=gFI0GOQd8swcyPbj6g/+ADtHIgovVh+z7vA0pkv/tF8+C3f3Nyvqn486jV6bI/YimFwHfoSgO76XCPYQ2yJjj11EiVwJcF+WNnyEzE6FHSsewjQV2gurH1+d4g8RU8ImY9U51BjSx9yIls3OlbacwtgWWtsfJMJZzZT877ZY0gA= Received: by 10.54.32.67 with SMTP id f67mr52943wrf; Sat, 05 Feb 2005 19:36:20 -0800 (PST) Received: by 10.54.37.16 with HTTP; Sat, 5 Feb 2005 19:36:19 -0800 (PST) Message-ID: <19861fba05020519366aec830e@mail.gmail.com> Date: Sun, 6 Feb 2005 04:36:19 +0100 From: J65nko BSD To: FreeBSD Mailing list In-Reply-To: <4204489E.3000703@nlcc.us> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050202131936.59448.qmail@web51702.mail.yahoo.com> <4204489E.3000703@nlcc.us> Subject: Re: keeping freebsd uptodate - doubt X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: J65nko BSD List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2005 03:36:22 -0000 On Fri, 04 Feb 2005 22:16:30 -0600, Billy Newsom wrote: > saravanan ganapathy wrote: > > cvsup -g -L 2 /root/ports-supfile > > Once you get your cvsup stuff straightened out, try this script, which I run > every other day. Change the Log file if you want. This updates my sources > to stable and updates the ports tree. I use two different cvsup files and > commands so the two don't get confused. Don't try to use the same config > file and cvsup command for the two different types of updates!! (In my > experience, you're asking for trouble.) > > You will need to install a few ports first, but you should get the idea. If > you read the output every day (or you could email it to yourself, which I may > eventually do if I like it), you will see which ports need to be updated. > This script will probably contiune to get better as it gets added to. Like I > need to include the security audited version of ports that need updated! > > BEGIN CODE... mydaily.sh > #!/bin/sh > # > # Billy borrowed stuff on 12/18/2004 from: > #http://www.oreillynet.com/pub/wlg/6041?page=last&x-order=date > # > LOGF="/var/log/cvsup.log" > echo "START @ `/bin/date`" >>$LOGF > #/bin/date >>$LOGF > #use fastest_cvsup to find fastest geographically > #close mirror; I'll check Canada and the US > > if SERVER=`/usr/local/bin/fastest_cvsup -Q -c ca,us`; then > echo "Using STABLE Server:" $SERVER >>$LOGF > /usr/local/bin/cvsup -L1 -h $SERVER -l /var/log/cvs-lock-s > /root/stable-supfile >>$LOGF > echo "STABLE done @ `/bin/date`" >>$LOGF > else > echo "cvsup-STABLE has a fastest_cvsup problem on...`/bin/date`" >>$LOGF > fi > > if SERVER=`/usr/local/bin/fastest_cvsup -Q -c ca,us`; then > echo "Using PORTS Server:" $SERVER >>$LOGF > /usr/local/bin/cvsup -L0 -h $SERVER -l /var/log/cvs-lock-p > /root/ports-supfile >>$LOGF > echo "PORTS done @ `/bin/date`" >>$LOGF > else > echo "cvsup-PORTS has a fastest_cvsup problem on...`/bin/date`" >>$LOGF > fi > > #-U (which takes a long time to execute) isn't needed > #with the fetchindex command > cd /usr/ports > make fetchindex >>$LOGF > /usr/local/sbin/portsdb -u >>$LOGF > # command1 2>&1 | command2 > > # echo "Looking for security patches" > # freebsd-update fetch > # This program not working for me. unComment above line if it works for U. > > echo "The following ports need upgrading" >>$LOGF > /usr/local/sbin/portversion -l "<" >>$LOGF > echo "" >>$LOGF > echo "STOP at `/bin/date`." >>$LOGF > echo "********" >>$LOGF > > END CODE... mydaily.sh > > -- > Billy > _______________________________________________ You can use "exec" at the top of your script to redirect all output to a file. This way don't need to add ">>$LOG" at the end of each line. -------------------- #!/bin/sh LOGF="/var/log/cvsup.log" # --- redirect all script output to logfile exec >>${LOGF} 2>&1 ------------------------ =Adriaan=