Sponsored Content
Top Forums Shell Programming and Scripting Trigger functionality in Unix Post 302687831 by Lem on Friday 17th of August 2012 06:17:31 AM
Old 08-17-2012
Instead of a script that runs every some minutes, why don't you parse in real time the logfile, so that you can send a message as soon as the phrase is read, every time it is read?

In bash (please, always write what your OS and your shell are) something like:
Code:
string="JFSnapshotService::systemSnapshot: Starting data capture. This may take awhile depending upon system workload."
tail -f logfile | while IFS= read -r line; do
if grep "$string" <<<$line &>/dev/null; then
{ do your stuff or send your messages ; }
fi
done

--
Bye
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed functionality

I have a few xml files and I want to input say 5 parameters within each file. is it possible to do so with sed? <parameter>A</parameter> <parameter>B</parameter> .... .... And so on. These parameters are meant to go in just inside: <?xml... (2 Replies)
Discussion started by: collern2
2 Replies

2. UNIX for Dummies Questions & Answers

How to send a trigger file from Unix to Windows

I need to send a file from a Unix box to a Windows sever to kick off a Crystal Reports job. Any good ideas how to do this? Can it be done with FTP? (0 Replies)
Discussion started by: robw95
0 Replies

3. UNIX for Advanced & Expert Users

Need Help with Unix/AIX functionality

I'll start this out by saying that I'm super-new to UNIX and need some help. My setup is as follows: I am currently running 3 UNIX boxes, 2 application servers and 1 db server. The first application server is my production box, the second application server is my test box, and the db server... (1 Reply)
Discussion started by: dkeaton
1 Replies

4. UNIX for Dummies Questions & Answers

using functionality in another ksh

i have a function defined in one ksh i want to use the same functionality in another ksh i am using . ../<ksh name> but it is not picking that functionality what i have to do for the same (2 Replies)
Discussion started by: trichyselva
2 Replies

5. Shell Programming and Scripting

Trigger whoever logged in sqlplus through UNIX

We had a requirement like we should find the user whoever logged into sqlplus through UNIX automatically. For that we should write a script and store the result in file. we will get that user manually by using WHO command. can anybody help me how to trigger? I tried many commands beyond... (1 Reply)
Discussion started by: siri_886
1 Replies

6. UNIX for Advanced & Expert Users

Functionality of ant build and ant deploy unix commands

I have made some code changes in the corresponding java file for date formatting purpose so that it supports upgraded sybase version from 12.6 to 12.7 and have build the code and deployed using the following UNIX commands. ant build ant deploy. "ant build" executes the build.xml which is... (1 Reply)
Discussion started by: vmpcit
1 Replies

7. Shell Programming and Scripting

Update trigger for unix file (solaris)

Hello, from log error file of process that i's updating in append mode, i need to capture the new entries for every day. How i can know and save only the new errors? This it's a sample of error log file (oas report server engine) thanks and regards Fran (2 Replies)
Discussion started by: fran61
2 Replies

8. Shell Programming and Scripting

Pipe Functionality

Hi, I am trying to emulate the '|' functionality through pipe function call. I am passing the o/p of exec in parent as input to the exec in child. The buf is readin the o/p but the exec in child is not working. Can somebody checkout the code and point where am i going wrong or missing something.... (3 Replies)
Discussion started by: amejoish
3 Replies

9. Shell Programming and Scripting

Source trigger in Unix shell

Hi All, Is ther any way to write the script with source trigger ? To trigger the script on particular time we have crontab. Similarly in a path, when a file comes particular script has to run. Thanks:) (7 Replies)
Discussion started by: jesu
7 Replies

10. UNIX for Dummies Questions & Answers

Zip -r Functionality

Hi , I've written the following code to zip the big file $dir_temp ="/home/etc/hst zip -r $dir_temp/file_nm.zip $dir_temp/file_nm The zip file has been created . When I try to UNZIP the file with the following command unzip file_nm.zip The file got unzipped but created in the... (3 Replies)
Discussion started by: smile689
3 Replies
PERF-SCHED(1)							    perf Manual 						     PERF-SCHED(1)

NAME
perf-sched - Tool to trace/measure scheduler properties (latencies) SYNOPSIS
perf sched {record|latency|map|replay|script} DESCRIPTION
There are five variants of perf sched: 'perf sched record <command>' to record the scheduling events of an arbitrary workload. 'perf sched latency' to report the per task scheduling latencies and other scheduling properties of the workload. 'perf sched script' to see a detailed trace of the workload that was recorded (aliased to 'perf script' for now). 'perf sched replay' to simulate the workload that was recorded via perf sched record. (this is done by starting up mockup threads that mimic the workload based on the events in the trace. These threads can then replay the timings (CPU runtime and sleep patterns) of the workload as it occurred when it was recorded - and can repeat it a number of times, measuring its performance.) 'perf sched map' to print a textual context-switching outline of workload captured via perf sched record. Columns stand for individual CPUs, and the two-letter shortcuts stand for tasks that are running on a CPU. A '*' denotes the CPU that had the event, and a dot signals an idle CPU. OPTIONS
-i, --input=<file> Input file name. (default: perf.data unless stdin is a fifo) -v, --verbose Be more verbose. (show symbol address, etc) -D, --dump-raw-trace= Display verbose dump of the sched data. SEE ALSO
perf-record(1) perf 06/30/2014 PERF-SCHED(1)
All times are GMT -4. The time now is 05:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy