not able to redirect the logs of a singl date in one system


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting not able to redirect the logs of a singl date in one system
# 1  
Old 06-17-2008
not able to redirect the logs of a singl date in one system

Hi All,

I have around 15 servers.

I need to check for the error in /var/adm/messages in 15 servers of current date everyday and log it in one server.

rsh is configured in all servers.

The command I am using to accomplish this in shell script is

rsh <remote sever> grep 'Jun 17' /var/adm/messages >> <file>

it is showing error :

grep: can't open 17

rsh <remote sever> grep 'Jun 17' /var/adm/messages|grep -i error>><file>

rsh <remote server> grep 'Jun 17' /var/adm/messages|grep -i error>><file>---obviously not working..

Please suggest for solution.
Thanks in advance.
# 2  
Old 06-17-2008
Code:
rsh <remote sever> "grep Jun\ 17 /var/adm/messages" >> <file>

# 3  
Old 08-08-2008
Not storing in the log file in the locals server

In the script I am using the line like it:
rsh $ip "grep -i `date '+%b\ %d'` /var/adm/messages" >>log.txt

Anyway the output is not storingin in local log file . At runtime I am getting the line like below.
rsh 10.209.96.72 grep -i Aug\ 08 /var/adm/messages

Please help where I am wrong.

Thanks in advance,
Partha
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies

2. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

3. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

4. Red Hat

Writing to System Logs

This isn't a RedHat specific question. The software in question might be used for any Linux distribution. Would it be advisable or inadvisable for my application, to be downloaded by many people I don't know, to write to the following logs in /var/log? maillog or mail.log messages secure ... (10 Replies)
Discussion started by: Brandon9000
10 Replies

5. Shell Programming and Scripting

Redirect all logs files contents into a single log file

Hi , I have a Data cleansing process which creates different log file for each step , when the process runs it creates following log files in below order: p1_tranfrmr_log.txt p1_tranfrmr_stats.txt p2_globrtr_log.txt p2_globrtr_stats.txt p3_cusparse_log.txt p3_cusparse_stats.txt ' '... (8 Replies)
Discussion started by: sonu_pal
8 Replies

6. AIX

system logs

good evening all dear all where i can find the system logs in AIX 5.3 (1 Reply)
Discussion started by: thecobra151
1 Replies

7. Solaris

logs for system shutdown

I am working on a SUN T2000 machine with Solaris 10 running on it. When I checked the system this morning, I found it to be turned off. The lastreboot command showed that the system had been shut down the previous night. I want to find out how the system was shut down. I have run hardware health... (2 Replies)
Discussion started by: batman727
2 Replies

8. AIX

System Logs

Dear Gurus I am running AIX with several users that are using the system, i would like to monitor the commands that are run by these users. Is there a log system that records the commands that are executed by the users??? Any kind of help will be appreciated. Regards Masquerder (6 Replies)
Discussion started by: masquerer
6 Replies

9. Solaris

Remove logs by date

Hi I Need To Remove Logs Older Than April 1 St(4/1/2007) By Date I Have A Script To Remove 3 Months Old Like Using 90 Days Thanks (3 Replies)
Discussion started by: cvdev
3 Replies

10. Solaris

system logs' life

How can you control old system logs keep(or storage) time in Solaris ? Is there any method ? it depends on buffer size long or date long ? (1 Reply)
Discussion started by: xramm
1 Replies
Login or Register to Ask a Question