Script Doesn't Work Correctly with Cron

Buck Turgidson jc_va@hotmail.com
Thu Dec 12 10:29:00 GMT 2002


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



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list