From owner-freebsd-questions@FreeBSD.ORG Thu Aug 26 07:42:23 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 77C2E16A4CF for ; Thu, 26 Aug 2004 07:42:23 +0000 (GMT) Received: from outbox.allstream.net (outbox.allstream.net [207.245.244.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B70543D4C for ; Thu, 26 Aug 2004 07:42:23 +0000 (GMT) (envelope-from epilogue@allstream.net) Received: from localhost (mon-pq50-059.dial.allstream.net [216.123.131.59]) by outbox.allstream.net (Allstream MTA) with SMTP id 4C26EEB314; Thu, 26 Aug 2004 03:42:21 -0400 (EDT) Date: Thu, 26 Aug 2004 03:42:20 -0400 From: epilogue To: krinklyfig@spymac.com Message-Id: <20040826034220.65118714@localhost> In-Reply-To: <200408260007.26659.krinklyfig@spymac.com> References: <200408260007.26659.krinklyfig@spymac.com> X-Mailer: Sylpheed-Claws 0.9.12 (GTK+ 1.2.10; i386-portbld-freebsd4.10) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: FreeBSD-questions Subject: Re: crontab question involving cvsup 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: Thu, 26 Aug 2004 07:42:23 -0000 On Thu, 26 Aug 2004 00:07:26 -0700 Joshua Tinnin wrote: > OK, I have searched the archives, and I can't find that my question has > been answered previously, but please forgive me if that's incorrect. > > I'm using (or rather trying to use) cron to update my ports tree daily. > I've tried several different combinations without success, and lately > this is what I have in my crontab file: > > /usr/local/bin/cvsup -g -L 2 /home/krinklyfig/supfiles/ports-supfile > && /usr/local/bin/portindex && /usr/local/sbin/portsdb -u > > It runs as root once a day. What appears to be happening is that the > cvsup is happening, but portindex is not, and because of the latter > portsdb -u doesn't either. The reason I know cvsup is working is > because portindex indicates that the ports tree has been updated if I > run it manually later, but running portversion before manually running > portindex will not indicate any changes. The cron log doesn't show > anything but the commands being executed. So, my question is: is this > type of command valid, or should each command be separate? Or is it not > working for some other reason? man cron gives: crontab [-u user] file 'file' being the important part, methinks. ;) what you might want to do, is simply write a shell script and feed that into your crontab. in case you're not sure how to make a script, it is very simple and google will return many tutorials. in a nutshell, you put the commands you want into a file, make that file executable (chmod), and away you go. the first line of a shell script has an obligatory format and invokes the shell that will be used. #!/bin/sh << the leading # is required /usr/local/bin/cvsup -L 2 /foo/path/to/your/ports-supfile; # comments are allowed portindex; exit note: you might also prefer to end commands with && rather than ; i'm new to scripting myself so please forgive my feeble explanation. about the commands which you are planning to include, why the 'portsdb -u'? is that not doing essentially the same work as 'portindex' ? (http://www.freshports.org/sysutils/portindex/) anyhow. hope this helps. cheers, epi