Control and monitoring file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Control and monitoring file
# 1  
Old 09-14-2012
Power Control and monitoring file

Hi guys today i have new situation to resolve.
I need to create a script that the first part it's already done but the problem appear when i run
other sart_script inside of it.
i need to check a log file until it stop after run the star script
when the log file stop write, then make a copy file
check again until log file stop write
So i copy again other files.
How can i make this works!

I have the idea to control the log_file, who tell me when i can execute the action (copy file),
which it's check the size of this logs every one minute or something like that.
for the buccle i've seen also the use of the sleep,that i guess it's a good idea to include.
Please any idea?
# 2  
Old 09-14-2012
post what you have done untill now...
# 3  
Old 09-14-2012
Hammer & Screwdriver

Here it's the code, it's not finish yet, but i'll try be clear..


Code:
#! /bin/bash
#This script stop and star an app, inlcude remove, and copying file, always monitoring a log file to take action 

#check if PID it's running
CheckP=`ps -ef | grep "SERVICE_SV" | grep -v grep`
if [ ! -z $CheckP ]
then 
echo "The application it's not running right now!!!!"
cd smxsv
cd /bin
sh shutdown_servicemix.sh  #for aipsnc08 doesn't exist, so ...kill -9 SERVICE_SV
#clean the cache
cd smxsv/data
rm -rf ./*
mkdir cd /esb/cargo/fuse/SMX_SV_$(date +%F)
cd /esb/cargo/fuse/hot
mv *cargo* ../SMX_SV_date(this should be the new dir i've created)
cd smxsv/bin
sh star.sh
...........
from here it's the problem i'll put it on pseudo code
next step
i.check logfile 
ii.wait until the log file stops moving
iii.then copy * sv_-shared-lib* to  hot dir
iv.wait until the log file stops moving
v.then copy * sv_cargo-sa* into hot dir

that's all
Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check whether file is processed in a control file list

I've a list of files which got processed in Target table A and stored in a control file(list of control files). I've want to trigger another process (later) based on this list of files and load into Target table B and continue running this process until this file list is exhuasted. How do I come... (1 Reply)
Discussion started by: manojg9
1 Replies

2. Shell Programming and Scripting

Formatting file data to another file (control character related)

I have to write a program to read data from files and then format into another file. However, I face a strange problem related to control character that I can't understand and solve. The source file is compose of many lines with such format: T_NAME|P_NAME|P_CODE|DOCUMENT_PATH|REG_DATE ... (3 Replies)
Discussion started by: hk6279
3 Replies

3. Shell Programming and Scripting

Control and monitoring file

Hi guys today i have new situation to resolve. I need to create a script that the first part it's already done but the problem appear when i run other sart_script inside of it. i need to check a log file until it stop after run the star script when the log file stop write, then make a copy file... (1 Reply)
Discussion started by: Newer
1 Replies

4. Shell Programming and Scripting

Control content of file

I want to control content of my mounted flash card which have string like "kernel32.dll". I explore some virus files have content of "kernel32". I find those files and rename this files.By shell programming. Not files name kernel32.dll. File include string like "kernel32.dll". Help me please (2 Replies)
Discussion started by: cashua66
2 Replies

5. Shell Programming and Scripting

Control file

if TERM has the value vt220, where will you expect to find its control file (0 Replies)
Discussion started by: thelakbe
0 Replies

6. Shell Programming and Scripting

File Monitoring

Hi all I have a ftp server where file will be ftped and processed and archived in archive once it's processed. The expected time for processing is 10 mins. I want to send an alert if any file is not processed and stays in ftp location for more than 10 mins. Please give me an idea how to... (2 Replies)
Discussion started by: johnl
2 Replies

7. Shell Programming and Scripting

file monitoring

hi all in my server all the users have the same paswd like "abc" .... i need to keep track of who changes the files using the ip addressess.... so once when a person logs in .. i need to monitor the actions or the files chagned by that person and store it in a log file .. can some one help me... (2 Replies)
Discussion started by: sais
2 Replies

8. Shell Programming and Scripting

Checking for a control file before processing a data file

Hi All, I am very new to Shell scripting... I got a requirement. I will have few text files(data files) in a particular directory. they will be with .txt extension. With same name, but with a different extension control files also will be there. For example, Sample_20081001.txt is the data... (4 Replies)
Discussion started by: purna.cherukuri
4 Replies

9. Programming

file monitoring

Hi i am am monitioring a file every 60 seconds and checking if the file has changed and if it has changed i append the changes to another file. i am able to monitior the change in file size but i have a problem copying the changes made in the file to another file. i am using lseek to seek the last... (1 Reply)
Discussion started by: problems
1 Replies
Login or Register to Ask a Question