Append log file through ssh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Append log file through ssh
# 1  
Old 06-29-2009
Append log file through ssh

Hello....

I am attempting to append a master log file with the contents of log files that are contained on about 7 servers.

Code:
#!/bin/sh
> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG
######################################################################
# Server Delphin / OS: Solaris
######################################################################
/lcl/bin/ssh delphin "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

######################################################################
# Server Angel / OS: Solaris
######################################################################
/lcl/bin/ssh angel "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

######################################################################
# Server Kraken / OS: Solaris
######################################################################
/lcl/bin/ssh kraken "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

######################################################################
# Server Prowler / OS: Solaris
######################################################################
/lcl/bin/ssh prowler "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

######################################################################
# Server Bluemarron / OS: Linux
######################################################################
/lcl/bin/ssh bluemarron "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

######################################################################
# Server Penguinshrimp / OS: Linux
######################################################################
/lcl/bin/ssh penguinshrimp "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

######################################################################
# Server Leviathan / OS: Solaris
######################################################################
/lcl/bin/ssh leviathan "/lcl/apps/Tivoli/omnibus_procedure_scripts/DBA_FILESYSTEM_LOGGER.LOG >> /gfs/infr/esm/scripts/DBA_FILESYSTEM_REPORT.LOG" &

However when I try the above I get....
Code:
cannot execute [Permission denied]

I am not sure why. These servers are listed in the .shosts file and I am able to ssh to them just fine. Now the master file I am attempting to append is on our NAS. Not sure if that maybe is the issue.

---------- Post updated at 10:20 AM ---------- Previous update was at 10:18 AM ----------

DUH! Helps if I use more. ;-) Just noticed.
# 2  
Old 07-02-2009
Quote:
DUH! Helps if I use more. ;-) Just noticed.
True, but in this case, "cat" is better suited to the purpose. "more" won't do any harm, though, because if the output is not a terminal, it acts like cat. However, I cannot guarantee it won't mangle special non-printable characters.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append date to sql*plus spool (log) file in shell script

SQL*Plus version : 11.2.0.4 OS : Oracle Linux 6.5 SQL*Plus is a client application to connect to oracle database. The log file for this tool is generated via spool command as shown below. I am trying to append date ( $dateString ) to spool file as shown below. $ cat test2.sh #!/bin/bash... (4 Replies)
Discussion started by: kraljic
4 Replies

2. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

3. Shell Programming and Scripting

remotely append crontab over ssh

Hi I would like to append/modify crontab remotely over ssh and this is what i have tried so far. text.txt contains the following line. 0,15,30,45 * * * * /home/local/hello.sh cat text.txt |ssh $host 'tee' but i dont know how to edit the crontab here after piping it to tee command. (2 Replies)
Discussion started by: xiamin
2 Replies

4. Shell Programming and Scripting

log file append

hi, I am working on perl script, printing useful info from script and while running appending to one file to maintain log. Log generates but at the end of the script and not continuously. I cant monitor whats happening.... Any specific reason? (5 Replies)
Discussion started by: Deei
5 Replies

5. Shell Programming and Scripting

Append Text To Remote Servers File Via SSH

Gentleman & Ladies, Please make me feel like and novice and explain why this is not working? I am attempting to ssh to a remote server via ssh and keys. I want to inject a file on the remote server with text. I am not achieving this. I would like to echo/inject the text on the remote... (1 Reply)
Discussion started by: abacus
1 Replies

6. Shell Programming and Scripting

Create log file in NFS via SSH

OS: Sun Solaris ver 9 From server1: as root userid ssh server2 /export/home/user1/.ssh/s2.sh logtest=/export/home/user1/test.log log1=/u03/user2/comn/admin/log/ uname -a >> $logtest --> log file able to generate uname -a >> $log1 --> not able to as /u03/user2/comn/admin/log is NFS from... (3 Replies)
Discussion started by: KhawHL
3 Replies

7. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

8. UNIX for Advanced & Expert Users

Shell script to append a time for the existing error log file

Hi Guys, the requirement is like this, i am having a error log file in this format, 4594.493: parallel nursery GC 2594592K->2544691K (2969600K), 30.848 ms 4605.958: parallel nursery GC 2634887K->2584986K (2969600K), 38.900 ms 4619.079: parallel nursery GC 2822555K->2774812K... (12 Replies)
Discussion started by: gsprasanna
12 Replies

9. Shell Programming and Scripting

crontab jobs to append to the same log

Hi, all: I have a shell script runs in the crontab, which writes the output to a log file, as following: 0 18 * * * /oracle/deleteBackup.sh >/oracle/deleteBackup.log Everytime the script is run by crontab , the deleteBackup.log is overwritten, is there anyway that I can append to the... (2 Replies)
Discussion started by: ericaworld
2 Replies

10. UNIX for Advanced & Expert Users

Append error message to the log

In my unix system , I chceck that there are error message append to the /var/adm/syslog . But I also found that part of these message will pop to my login session ( I use telent to login to server ) , I also check the /var/mail/my_loginid is empty , could suggest how can I forbid the message pop to... (1 Reply)
Discussion started by: ust
1 Replies
Login or Register to Ask a Question