Monitor file generation for an hour using Korn shell script
Hi,
I am new to this unix scripting, I got a requirement like..
Files with *.XML extension will be generating in a /home/sample/ folder for every 15 mins. I need to monitor those files in that particular folder for every hour.
If no file has been generated in that particular folder for an hour, need to send a mail to particular group.
Kindly post the script, or an extract thereof... so we can see what you've done so far. That way it's easier to post suggestions or pointers...
I will however suggest you familiarise yourself with the 'date' command... that way you can simply do a something like this:
the output should be something like this:
May 6 11:27:20 (you can use sed to remove ":20"
then do a listing for all *.XML files in that directory:
using the two variables returned... you can use some arithmetic, and do a subtraction, to compare the timestamp of the last file generated, to the current time (you can use an if statement for this).
Monitor file generation for an hour using Korn shell script
Hi ,
I want to write the shell script in UNIX box. Could you please send me the code.
Files with *.XML extension will be generating in a /home/sample/ folder for every 15 mins. I need to monitor those files in that particular folder for every hour.
If no file has been generated in that particular folder for an hour, need to send a mail to particular group.
Have you tried the code i sent you in the previous post?
I understand you want to write the script on a UNIX box... are you speaking of solaris? if so what version?
Have you started with the script already, or are you just looking for somebody to send you the working code? Since you mentioned you are new to scripting, I don't think it would be advisable to do copy, pastes of code... You need to understand what the commands in your script do, and how they work...
Please type the following command:
Last edited by Scott; 05-06-2010 at 07:04 AM..
Reason: Removed strange language
I am attempting to write a korn shell script that does the following, but I am getting errors. I'm new to korn shell scripting and am not sure what I am doing wrong. Please help with example scripts. Thanks.
1) check for day of the week
2) if day of the week is Monday then check for the... (4 Replies)
I want to write a korn shell script to get the latest three versions for a file in the directory having lot of files with various versions (files with prefix as same but time stamp as suffix) and compress it and at the same time have to remove the remaining versions of the file (other than latest... (4 Replies)
Hi,
On Linux RedHat 5 ( 2.6.18-194.el5 ) I need to monitor process that consumes 100% CPU during more than 01 Hour.
Are there command lines ? scripts ?
Regards, (11 Replies)
Hi
I am looking for a help in designing a bash script on linux which can do below:-
1) Look in a specific directory for any new files
2) Mail the content of the new file
Appreciate any help
Regards
Neha (5 Replies)
Hi,
I have files in the directory like below which I need to validate if all the required files are present.
A_B_001 of 002_time1.txt
A_B_002 of 002_time1.txt
A_B_001 of 001_time2.txt
Scenarios-
a)If file with 001 of 002_time1 or 002 of 002_time1 is missing in the folder,script should... (6 Replies)
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
All,
Can anyone please help me with the below scenario in korn shell script.
Can anyone please give me some hints to proceed on this.
I have a Flat file of the below format.
Input file format:... (1 Reply)
Hi,
Im trying to write this script but im stuck on it, basicaly what i want to do is to write a code to verify a log file ( apache log file for example ) and for each new line with specific data , then, output this new line for another file:
full ex:
output of the server.log is (... (4 Replies)
Hello,
How do I write a korn shell that will rename file with the current date. What I want to do is, I have a file that is re-written every day. But instead, I want to keep a 14 day history of the file. So I want to write a script that will rename the current file with a date attached to the... (2 Replies)
I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1... (2 Replies)