From owner-freebsd-questions@FreeBSD.ORG Fri Sep 12 15:01:50 2003 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 8D97A16A4BF for ; Fri, 12 Sep 2003 15:01:50 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id C186043FDD for ; Fri, 12 Sep 2003 15:01:49 -0700 (PDT) (envelope-from gsam@trini0.org) Received: from hivemind.trini0.org (trini0.org[68.39.114.118]) by comcast.net (sccrmhc13) with ESMTP id <20030912220149016006rt23e>; Fri, 12 Sep 2003 22:01:49 +0000 Received: from trini0.org (gladiator.trini0.org [192.168.0.3]) by hivemind.trini0.org (Postfix) with ESMTP id 7908E1C4 for ; Fri, 12 Sep 2003 18:01:45 -0400 (EDT) Message-ID: <3F624249.6090300@trini0.org> Date: Fri, 12 Sep 2003 18:01:45 -0400 From: Gerard Samuel User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030701 X-Accept-Language: en, nl, ar, th, en-us MIME-Version: 1.0 To: FreeBSD Questions References: <3F620FD4.1090207@trini0.org> In-Reply-To: <3F620FD4.1090207@trini0.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Script doesn't complete via Cron 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: Fri, 12 Sep 2003 22:01:50 -0000 Ok, I figured out the problem. The step that creates the zip file, wasn't creating the zip file, because, I wasn't using the full path to the zip command. Since there was no files to scp, the script ended. Once I started using /usr/local/bin/zip, things started working correctly with cron. Gerard Samuel wrote: > Script -> > -------- > #!/bin/sh > # > # To roll up a zip file of source code > # > > date=`date '+%Y-%m-%d'` > > cd ~/temp > rm -rf foo_dev foo.zip > export CVS_RSH=ssh > export CVSROOT=:ext:xxx@xxx.xxx.xxx:/xxx/yyy/zzz > cvs -Q export -D $date -d foo_dev foo > zip -q -r foo foo_dev > scp -q foo.zip server_name: > rm -rf foo_dev foo.zip > > ------ > > Cron job -> > ------ > # export, zip up and scp foo source to server_name > 17 14 * * * /home/bar/bin/export-foo > 2> /dev/null > /dev/null > ------ > > When I execute the script by hand, it completes without any problems. > When I let a cronjob handle it, it doesn't scp the zip file to the > remote server. > I don't get any errors in /var/log/auth.log or /var/log/messages > Anyone has any ideas on how to fix this up? > > Thanks