X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <4B16E4A1.4000700@cs.umass.edu> Date: Wed, 02 Dec 2009 17:05:21 -0500 From: Eliot Moss User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Problem with bash script running under NT AUTHORITY\SYSTEM References: <26617039 DOT post AT talk DOT nabble DOT com> In-Reply-To: <26617039.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Almo wrote: > Hi! > > I'm using cygwin and this command in a function works when I'm logged in as > me: > > gzip -f ./$1.sql 2>> error.log > > so it zips hyperquest_v2.sql as the argument I send it is "hyperquest_v2". > > When this is run from NT AUTHORITY\SYSTEM as a scheduled task, I get an > error. So I put in some debug output: (I also have to specify where gzip.exe > is so that account can find it, hence the "/usr/bin/" part) > > echo "/usr/bin/gzip -f ./$1.sql 2>> error.log" >> error.log > usr/bin/gzip -f ./$1.sql 2>> error.log > > The output I get is: > > hyperquest_v2.sql > /usr/bin/gzip -f ./hyperquest_v2.sql 2>> error.log > usr/bin/gzip: No such file or directory Could it be that the current working directory (.) in this scenario is not the one you think it is? It may be some random place that the scheduled task is using ... Maybe echo $PWD to see? Regards -- Eliot Moss -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple