This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Shell script wont run with cron, but it works ok in the command line.

How can I make the mv, and rm commands excecutable by
system? where I can add the path to this commands for

This is the hint I have been looking for since Dec

thanks in advance!


Re: Script Doesn't Work Correctly with Cron
From: Igor Pechtchanski <pechtcha at cs dot nyu dot
To: Buck Turgidson <jc_va at hotmail dot com> 
Cc: cygwin at cygwin dot com 
Date: Thu, 12 Dec 2002 13:26:48 -0500 (EST) 
Subject: Re: Script Doesn't Work Correctly with Cron 
Reply-to: cygwin at cygwin dot com 


On Thu, 12 Dec 2002, Buck Turgidson wrote:

> I have a script that works when I run it from the
command line, but when it
> is executed with cron, it produces a null file.  I
am sure that cron is
> executing it because it creates the file.  It is
just not populated.
> Here is the script.  I want to query an Oracle
database every couple of
> minutes, capture some data, and append it to a flat
file.  I want to keep
> 2000 lines in the flat file.
> Can someone spot the error?  Again, it works run
from the command line.
> #!/bin/bash
> sqlplus -s  scott@mydb < up @ss.sql | grep -v "Enter
password:" >>
> monsql.lst
> tail -2000 monsql.lst  > montemp.lst
> rm -f monsql.lst
> mv montemp.lst  monsql.lst

This is probably not cron-specific, but try
redirecting stderr to a file
(by using "2>filename") to see if the script produces
any errors.  Also,
are all the programs you use (sqlplus, grep, tail, rm,
mv) in the path for
the user that cron runs as (most likely "system")? 
Are they executable by

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]