Log file generation from crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Log file generation from crontab
# 1  
Old 10-02-2014
Log file generation from crontab

Hi All,
Like to enquire whether is it possible for me to append another log file(log2.lst) using my below crontab? I will need to have 2 log files generated; one to collect the daily appended output and another log file that contains only the daily output.

Original Code:
Code:
00 01 * * * /export/home/batch.job 1>/export/home/logs/log1.lst 2>>/export/home/logs/error.err

Appreciate if anyone can assist.

Thanks.

Last edited by vbe; 10-02-2014 at 11:08 AM..
# 2  
Old 10-02-2014
somewhat of a vague ask, but....
Code:
00 01 * * * /export/home/batch.job 1>/export/home/logs/log1.lst 2>>/export/home/logs/error.err && hereIappendAnotherFileSimilarToLog1 ......


Last edited by vgersh99; 10-02-2014 at 12:57 PM..
# 3  
Old 10-02-2014
How about tee -a?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Xls file generation

Hi Team, Is it possible to generate the xls OR xlsx file factility in Unix and xls file should be more than one sheet. (2 Replies)
Discussion started by: bmk123
2 Replies

2. Shell Programming and Scripting

Log file is not updating when I run shell scripts scheduled thru crontab

Hi Forum, Good Day! I have created an empty html file wtih permissoin 777 created shell script(with permission 777) , code is below. #=======================start============== . /data09/oracle/apps_st/appl/D_oraapp095.env rm -rf /home/mnp/Test_log.txt echo... (1 Reply)
Discussion started by: kartheekbk
1 Replies

3. UNIX for Dummies Questions & Answers

Core File Generation

Hi I am using Linux and I am using Java as well as C++ services running on it. The ulimit -c is set to around 400Mb. Whenever any of the service fails they produce a core file.(Actual size of core could be greater than 400Mb). Whenever my Java service fails I get a core file of size 400Mb... (3 Replies)
Discussion started by: Raj999
3 Replies

4. Shell Programming and Scripting

Help with file generation

Dear all Hope you are doing good. I've requirement where in I need to generate a file containing set of SQLs as per the inputs. My script flow is like reading few parameters using read command to read input to script and process the inputs. However at one of the input, my script has to... (3 Replies)
Discussion started by: tenderfoot
3 Replies

5. UNIX for Dummies Questions & Answers

XML File Generation - Template Help

Hi, I have hit a bit of a brick wall.:confused: need the following code edited: echo "<?xml version=\"1.0\"?><dailyBalance_ROWSET>" > ${DataDir}/${extract_script}${ApplicationDate}.${Suffix} RunSQL ${extract_script} ${ActionFlag} echo "</dailyBalance_ROWSET>" >>... (2 Replies)
Discussion started by: Xergxes7
2 Replies

6. Shell Programming and Scripting

Log file being not generated in crontab

My shell script it.sh #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH today=`date "+%m-%d-%Y %H:%M:%S"`; export today CUR_DIR=$1; export CUR_DIR LOG_FILE=error.log; export LOG_FILE # Direct script output to... (4 Replies)
Discussion started by: rafa_fed2
4 Replies

7. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

8. Shell Programming and Scripting

generation of control file

Hi, I wanted to create a control file with data in it. Also wanted to append more points like 1)Row count, then print the first field 2)first line of the file 3)last line of the file I started with this:- ls -ltr *.*| awk ' { print $9 "|" $7 $6 $8 "|" $5 } ' sed -n '1p'; sed -n '$p'; ... (2 Replies)
Discussion started by: alokbaba
2 Replies

9. Shell Programming and Scripting

File Report Generation

hi all i need to generate a report file that contains the following details of files present in a directory. 1. File name 2.Complete path for each files and directory 3.File size 4.Days older example i have a directory testing that contains sub-directories and some files. i need to make a... (5 Replies)
Discussion started by: yashwantkumar
5 Replies

10. UNIX for Advanced & Expert Users

Crontab Error - creating zero byte log file

Hi, I am trying to run a shell script using the crontab scheduler, and I am redirecting the log of the script output to some temp log file using the following command. sh somescript.sh 1> /location/somefile.log Evrytime the cronjob triggers this script, It creates a zero byte file in the... (4 Replies)
Discussion started by: DSDexter
4 Replies
Login or Register to Ask a Question