How can I put same message in two different log files?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can I put same message in two different log files?
# 1  
Old 05-07-2008
How can I put same message in two different log files?

echo "$(date +'%m/%d/%Y %X')" >> LOGFILE1
echo "$(date +'%m/%d/%Y %X')" >> LOGFILE2

How can I put same message in two different log file?
# 2  
Old 05-07-2008
You can duplicate the stdout with tee command:

Code:
echo "$(date +'%m/%d/%Y %X')" | tee -a $LOGFILE1 >> $LOGFILE2

# 3  
Old 05-07-2008
Thanks a lot
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Can C program put message to IBM MQ remotely, if local server doesn't have MQ library?

Can somebody know if it is possible to connect to remote IBM MQ, if local server using C, but don't have MQ library? Thanks for contribution (0 Replies)
Discussion started by: digioleg54
0 Replies

2. Shell Programming and Scripting

How to put variables commands in config files?

Hi All, Seeking for your assistance on how to put in variables all the commands in /bin config files: /home/test/config_file/config.cfg cat /home/test/config_file/config.cfg ECHO=/bin/echo LS=/bin/lsMain script cat test.sh source=/home/test/config_file/config.cfg ECHO=$ECHO LS=$LS#i... (3 Replies)
Discussion started by: znesotomayor
3 Replies

3. Shell Programming and Scripting

How to concatene files and put each line of files on a specific position ?

Hi, I have some files that i want to concatene and put each of lines of this files on a specific position : File1 AAAAAAA BBBBBBB CCCCCCC File2 DDDDDDD EEEEEEE FFFFFFF File3 GGGGGG HHHHHH IIIIII New file (6 Replies)
Discussion started by: apippo70
6 Replies

4. Shell Programming and Scripting

how to put subject and body to mail from two files

Hi all, My sample file is something like this, ORA-00206: Message 206 not found; product=RDBMS; facility=ORA ORA-00202: Message 202 not found; product=RDBMS; facility=ORA ORA-27063: Message 27063 not found; product=RDBMS; facility=ORA ORA-00206: Message 206 not found; ... (1 Reply)
Discussion started by: sri1977
1 Replies

5. Shell Programming and Scripting

How can view log messages between two time frame from /var/log/message or any type of log files

How can view log messages between two time frame from /var/log/message or any type of log files. when logfiles are very big and especially many messages with in few minutes, I would like to display log messages between 5 minute interval. Could you pls give me the command? (1 Reply)
Discussion started by: johnveslin
1 Replies

6. UNIX for Dummies Questions & Answers

Tarred files not being put on tape

Hi I normally backup to tape using the following command in Solaris 9 on SUN Enterprise 3500 server: tar cvf /dev/rmt/0n data but after a power cut, the server went down without being shutdown since the UPS failed. Now when I issue the tar command I get the root (/) being full looks like it... (6 Replies)
Discussion started by: rahmantanko
6 Replies

7. Shell Programming and Scripting

Put the difference of two files in out file

Hello, I have two files file1 & file2 containing both lines (1 word per line). I need to extract the lines that are in file1 and not present in file2 and have the result in output file. i.e : user>cat file1 line1 line2 line3 line4 line5 user>cat file2 line1 line3 line5 The... (2 Replies)
Discussion started by: newpromo
2 Replies

8. Shell Programming and Scripting

Read multiple log files and create output file and put the result

OS : Linux 2.6.9-67 - Red Hat Enterprise Linux ES release 4 Looking for a script that reads the following log files that gets generated everynight between 2 - 5am Master_App_20090717.log Master_App1_20090717.log Master_App2_20090717.log Master_App3_20090717.log... (2 Replies)
Discussion started by: aavam
2 Replies

9. UNIX and Linux Applications

sftp -> put : How to uplaod only newer files

I have tried winscp, filezilla to copy data from windows xp SP2 machine to the sun sparc unix machine. However speed is around 120 to 130 kb/sec. I do have lot of files & with large size. So I switched to windows command prompt & transfered few files using sftp command. Its very fast as compared... (0 Replies)
Discussion started by: _prasad
0 Replies
Login or Register to Ask a Question