Sponsored Content
Top Forums Shell Programming and Scripting How to append the output continously from a script Post 302277770 by cfajohnson on Saturday 17th of January 2009 11:40:27 PM
Old 01-18-2009
Quote:
Originally Posted by nirmal84
Hi All,

Am using the below script to produce some statistics. Currently it send the results to a log file and sends the contents of the log to a mail ID.
Next time when it runs it erases the previous log and writes the latest output to the log file.

I want the output to be appended to the script and also the script should send email only with the latest result.

Code:
. $HOME/.profile
{
  echo "****CDR and SDR Queue****"
  gs_admin | awk '
     /^Queue/ {print $1,$2,$3,$4}
     /^cdr/ || /^sdr/ {print $1,"\t\t"$2,"\t\t"$3,"\t\t"$4}
   '
  echo "name state last op busy%"
  cross_stat -server | awk '/sdr/ || /cdr/ '{print $2,$7,$9,$10}'
  echo ""
  echo "****CPU Usage****"
  uptime
} | tee -a mg_stat.log |
  mailx -s "MG Stat" n.appandairajan@rci.example.com

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append output to file

Hi, I have a script below. It get's the data from the output of a script that is running hourly. My problem is every time my script runs, it deletes the previous data and put the current data. Please see output below. What I would like to do is to have the hourly output to be appended on the... (3 Replies)
Discussion started by: ayhanne
3 Replies

2. UNIX for Dummies Questions & Answers

Script should run continously

Hi I have a small req. I have a script called as abc.sh I want to execute this script continously for every 1 minute even if i exit from the server i.e., it should keeps on running for every one minute even if i logged off Can any one send me the sample code or procedure to work... (3 Replies)
Discussion started by: pssandeep
3 Replies

3. Shell Programming and Scripting

md5sum output append

Hi there, I have 2 fairly simple lines I am running and both work as expected, but I am trying to append the two of them to output a single line. The first command get the MAC times of each file :- find /media/Vista/Garmin/PCBSMP2/ -type f -printf "%A+ (a) %p\n%T+ (m) %p\n%C+ (c) %p\n" ... (9 Replies)
Discussion started by: kogorman
9 Replies

4. Shell Programming and Scripting

Append color in shell script for output

Hi Experts, I want to get my shell script output in a color for a particular word. PFB my output. TT.QM.JTV1S1 TLORSBT2.JMR701T1.C1 REPOS TT.QM.JTV1R1 TLORSBF2.JMR701T1.C1 NORMAL whenever REPOS word comes then entire line should come in red color. Can you please help me... (4 Replies)
Discussion started by: darling
4 Replies

5. Shell Programming and Scripting

How to print and append output of nawk script in commandline and as well into a file?

Hi All, I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file. Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file. script :... (3 Replies)
Discussion started by: Optimus81
3 Replies

6. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

7. Shell Programming and Scripting

Run the script continously but mail once in 1 hour

Hi, I have a script written for monitoring the queue manager status continously. below is the script. QMGR=`dspmq | awk '{print $1}' | cut -f2 -d "(" | cut -f1 -d ")"` QMSTATUS=`dspmq | awk '{print $2}' | cut -f2 -d "(" | cut -f1 -d ")"` count=`dspmq | awk '{print $1}' | cut -f2 -d "(" | ... (5 Replies)
Discussion started by: Anusha M
5 Replies

8. Shell Programming and Scripting

How to append the output in a new column?

input1 john 20 bob 30 input2 john 60 bob 100 cat input1 >> output cat input2 >> output ouput john 20 bob 30 john 60 bob 100 desired output input1 input1 input2 input2 john 20 john 60 (3 Replies)
Discussion started by: quincyjones
3 Replies

9. UNIX for Beginners Questions & Answers

WHy do we need both append and output directives?

Hi, I was reviewing a shell script and I found this line: yum -y update >> >(/usr/bin/tee /var/log/file) I have tried removing the >> directive and all that will occur is that the file will be created--nothing gets put in the file. If I put back the >> directive it works. If I remove the... (3 Replies)
Discussion started by: mojoman
3 Replies

10. Programming

Python script to run multiple command and append data in output csv file

Experts, I am writing a script and able to write only small piece of code and not able to collect logic to complete this task. In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file Now have to... (0 Replies)
Discussion started by: as7951
0 Replies
Git::Repository::Log(3pm)				User Contributed Perl Documentation				 Git::Repository::Log(3pm)

NAME
Git::Repository::Log - Class representing git log data SYNOPSIS
# load the Log plugin use Git::Repository 'Log'; # get the log for last commit my ($log) = Git::Repository->log( '-1' ); # get the author's email print my $email = $log->author_email; DESCRIPTION
"Git::Repository::Log" is a class whose instances reprensent log items from a git log stream. CONSTRUCTOR
This method shouldn't be used directly. "Git::Repository::Log::Iterator" should be the preferred way to create "Git::Repository::Log" objects. new( @args ) Create a new "Git::Repository::Log" instance, using the list of key/values passed as parameters. The supported keys are (from the output of "git log --pretty=raw"): commit The commit id (ignore the extra information added by --decorate). tree The tree id. parent The parent list, separated by spaces. author The author information. committer The committer information. message The log message (including the 4-space indent normally output by git log). extra Any extra text that might be added by extra options passed to git log. ACCESSORS
The following accessors methods are recognized. They all return scalars, except for "parent()", which returns a list. Commit information commit tree parent Author and committer information author committer The original author/committer line author_name committer_name author_email committer_email Date information author_gmtime committer_gmtime author_localtime committer_localtime author_tz committer_tz Log information raw_message The log message with the 4-space indent output by git log. message The unindented version of the log message. subject body Extra information extra AUTHOR
Philippe Bruhat (BooK), "<book at cpan.org>" COPYRIGHT
Copyright 2010 Philippe Bruhat (BooK), all rights reserved. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-12-28 Git::Repository::Log(3pm)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy