![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to write a script in UNIX to find a file if another file exists | mmdawg | Shell Programming and Scripting | 1 | 05-04-2008 07:40 PM |
| unix script to takes the old data from a TXT file and compress them into new file | vpandey | Shell Programming and Scripting | 2 | 03-05-2008 08:10 AM |
| Shell Script to Load data into the database using a .csv file and .ctl file | Csmani | Shell Programming and Scripting | 3 | 05-24-2006 05:09 AM |
| how to find Script file location inside script | asami | Shell Programming and Scripting | 10 | 03-14-2006 09:57 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 02:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Log file for a Script
Oracle92 on solaris 8.
We have a Truncate Script that runs every night to cleanup certain tables , so new data gets loaded into. This Script is run in Unix Shell script where i set Environment varibles, and things like that.. Now, how do i create a log file of the script , to see weather the script really deleted the data ? ========================== #!/bin/ksh ORACLE_BASE=/u10/app/ORACLE ORACLE_DOC=$ORACLE_BASE/doc ORACLE_HOME=$ORACLE_BASE/product/9.2.0.1.0 ORACLE_SID=dss PATH=/usr/bin:/usr/ucb:/usr/sbin:/etc:/usr/inform/PowerMart:/usr/inform/RepServer:/usr/inform/scripts:$ORACLE_HOME/bin:/usr/bin:/bin:/usr/ccs/bin:/usr/ucb:/etc:/usr/openwin/bin:/usr/local/bin:. TNS_ADMIN=$ORACLE_HOME/network/admin LD_LIBRARY_PATH=/usr/inform/PowerMart:/usr/inform/RepServer:$ORACLE_HOME/lib32 export PATH PM_HOME ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH TNS_ADMIN export PARMS=/usr/inform/scripts/WorkFlow/dss_parms ORADBUSER=`cat $PARMS |grep ORADBUSER|cut -d":" -f2` ORADBPASSWD=`cat $PARMS |grep ORADBPASSWD|cut -d":" -f2` $ORACLE_HOME/bin/sqlplus -s << EOF $ORADBUSER/$ORADBPASSWD set heading off; set feedback off; set echo off; truncate table current_year; commit; ============================= Thanks Ron |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
The simplest way, assuming you are using cron to run the script is to redirect the cron job stdout and stderr to a file.
|
|
#3
|
|||
|
|||
|
Dear
if you are runnning the script from crontab,then the output will be mailed to the owner user. also you can put the script output in one file and the error in another one as below your_script.sh > outfile 2> errfile Regards; TheEngineer IBM Certified Specialist |
|
#4
|
|||
|
|||
|
i see in your script that you do "set echo off", however it is related to oracle ,to see the truncate command output set echo on so you will findout weather it truncate the table or not
|
|||
| Google The UNIX and Linux Forums |