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
filebench(1)							   USER COMMANDS						      filebench(1)

NAME
filebench - interprets WML script and generates appropriate filesystem workload SYNOPSIS
filebench [-f <filename>] [-h] DESCRIPTION
Filebench is a file system and storage benchmark that allows to generate a large variety of workloads. Unlike typical benchmarks it is very flexible and allows to minutely specify (any) applications' behaviour using extensive Workload Model Language (WML). Filebench uses load- able workload personalities to allow easy emulation of complex applications (e.g., mail, web, file, and database servers). Filebench is quick to set up and easy to use compared to deploying real applications. It is also a handy tool for micro-benchmarking. Filebench includes many features to facilitate file system benchmarking: o Multiple workload types support via loadable personalities o Ships with more than 40 pre-defined personalities, including the one that describe mail, web, file, and database servers behaviour o Easy to add new personalities using reach Workload Model Language (WML) o Multi-process and multi-thread workload support o Configurable directory hierarchies with depth, width, and file sizes set to given statistical distributions o Support of asynchronous I/O and process synchronization primitives o Integrated statistics for throughput, latency, and CPU cycle counts per system call OPTIONS
-f <filename> use specified file as an input instead of stdin -h Display verbose help EXAMPLES
Run filebench interactively: $ filebench Start filebench interactive shell, filebench prompt will appear after that. filebench> load fileserver Load fileserver personality using load command. filebench> set $dir=/mnt After personality is loaded, tunables of the workload personality can be set. Here we change the benchmark directory to /mnt where the file system we want to benchmark is presumably mounted. filebench> run 60 Start workload for 60 seconds. After 60 seconds of the run the statistics is printed and Filebench exits. Run filebench non-interactively: filebench -f /usr/share/filebench/workloads/fileserver.f Run filebench non-interactively, however, you need to add 'run <time>' to the end of the workload personality file before calling filebench. EXIT STATUS
0 if OK, 1 if workload file is not found. REPORTING BUGS
http://sourceforge.net/tracker/?group_id=133644&atid=727883 revision 01 Sep 1, 2011 filebench(1)
All times are GMT -4. The time now is 10:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy