From owner-freebsd-questions@FreeBSD.ORG Mon Jun 25 14:49:16 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 2B4B616A421 for ; Mon, 25 Jun 2007 14:49:16 +0000 (UTC) (envelope-from oregnier@oregnier.net) Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by mx1.freebsd.org (Postfix) with SMTP id 9AA0813C457 for ; Mon, 25 Jun 2007 14:49:15 +0000 (UTC) (envelope-from oregnier@oregnier.net) Received: (qmail 15767 invoked by uid 503); 25 Jun 2007 14:49:35 -0000 Received: (QMFILT: 1.0); 25 Jun 2007 14:49:35 -0000 Received: from b7.ovh.net (HELO mail185.ha.ovh.net) (213.186.33.57) by 30.mail-out.ovh.net with SMTP; 25 Jun 2007 14:49:34 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 25 Jun 2007 14:49:06 -0000 Received: from mac76-2-82-241-6-173.fbx.proxad.net (HELO ?127.0.0.1?) (postmaster@oregnier.net@82.241.6.173) by ns0.ovh.net with SMTP; 25 Jun 2007 14:49:05 -0000 Message-ID: <467FD67B.9070604@oregnier.net> Date: Mon, 25 Jun 2007 16:51:39 +0200 From: Olivier Regnier User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: multipart/mixed; boundary="------------090304030508070909000707" X-Ovh-Remote: 82.241.6.173 (mac76-2-82-241-6-173.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N Subject: 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 14:49:16 -0000 This is a multi-part message in MIME format. --------------090304030508070909000707 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 :) --------------090304030508070909000707 Content-Type: text/plain; name="610.update-ports-tree" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="610.update-ports-tree" #!/bin/sh # if there is a global system configuration file, suck it in. # if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs fi COUNTRIE=us RETVAL=0 DATE=`date +%d/%m/%Y` LOGFILE=/var/log/system-update-report.log selectserver() { # Checking fastest cvs server server=`/usr/local/bin/fastest_cvsup -c $COUNTRIE | grep "1st" | \ awk {'print $3'}` # Creating supfile sed "s/*default host=.*/*default host=$server/" \ /usr/share/examples/cvsup/ports-supfile > /etc/ports-supfile } case "$daily_update_ports_tree_enable" in [Yy][Ee][Ss]) # Begin selectserver # Fetching sources files /usr/bin/csup /etc/ports-supfile RETVAL=$? if [ $RETVAL != 0 ] then echo "-> $DATE - Ports tree: error while fetching sources files." \ >> $LOGFILE exit 0 fi # Creating INDEX.db file /usr/local/sbin/portsdb -Fu RETVAL=$? if [ $RETVAL != 0 ] then echo "-> $DATE - Ports tree: error while creating INDEX.db file" \ >> $LOGFILE exit 0 fi # Checking if applications needs to be updated LIST=`/usr/local/sbin/portversion -l "<"` RETVAL=$? if [ $RETVAL != 0 ] then echo "-> $DATE - Ports tree: error while checking updates" \ >> $LOGFILE exit 0 fi # Result if [ "$LIST" = "" ] then echo "-> $DATE - Ports tree: Up-To-Date" >> $LOGFILE else echo -e "-> $DATE - Ports tree: Up-To-Date. Here is list of \ applications needs to be updated.\n\n$LIST" >> $LOGFILE fi *) rc=0;; esac exit $rc --------------090304030508070909000707--