I need some assistance with respect to perl script for checking files.
I have near about 100 path for which I need to check whether the give path does have file or not .
I have created a script but it is not working the way I want
My requirement is :-
Script should check if the file exist or not , if yes it should print “asking us to check whether batch is running or not “ else nothing . apart from that if files exist is more than 5 than it should trigger us an email
My script is able to search the path and able to check but the counter which has been used is not getting incremented if the file exist or not .
script which i have created :-
Output coming in data1 will have those path where file exist and the same file will be sent as an email .
Could you please assist me what needs to be corrected in order to achive below objective
1) script should check all the path mention in file "path_file.txt".
2) if any of the path mention has files , it should write it in to data1.txt with DIR
3) after completion of entire script i want that file to be sent as an email
4) if their are not files in any of the path data1.txt should not be created .
please advice .
Last edited by Franklin52; 07-12-2014 at 03:52 PM..
Reason: Please use code tags
No not at all
We use TWS to support our customer and most of time whenever we have files in place jobs which are schedule to process doesn't work , I would not say most of the time but very frequent .
So we came up with an idea of having a script in place which will check the Path and if we have more than 5 files in place it should trigger an alert via sending an email. Once email is send we have support team who check respective job , whether its in execution or not , if not they will reach us . In few occasion this has really help us to identify the problem before customer reaches us . That's what we been paid for.
I have created a script which just checks 1 path and it works fine. if the same thing needs to be implemented than I have to created approx 100 plus script to check different path . to overcome I have created a script which I have posted, it check all the path mention in the file.
Master server is a windows and it only support Perl and I have very little experience in PERL. The script which I have worked on is able to identify everything but only problem is it is not getting incremented.
I would have used the same script and would have published the output which is getting generated in data1.txt.
Reason for this post is if someone would come up with different idea or expertise which I was missing in my script.
I'm new to GTK development, so I've been going through the examples just to capture the basics. I've done a lot of Unix GUI development before, but it was all Xt/Motif stuff. So, the GTK scheduler is something new to me.
That said, I was going through the color selection example here, and was... (8 Replies)
Gents,
I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Hi all,
I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first.
Can you please help me determine which one to... (14 Replies)
Hi
How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies
6. Post Here to Contact Site Administrators and Moderators
Hi Folks,
I need to compare two very huge file ( i.e the files would contain a minimum of 70k records each) using awk or sed. The comparison needs to be done with respect to a 'key'. For example :
File1
**********
1234|TONY|Y75634|20/07/2008
1235|TINA|XCVB56|30/07/2009... (13 Replies)
Hi,
Please help me in the below:
I am trying to sort it in date order but I am failing somewhere L . Can anyone please help me on this? Your help is most appreciated on this.
$ autorep -j EDSPME% | grep ' OI' | grep -v '^ ' |awk '{print $4 " " $1}'| sort -r -t/ -k 3 -k 2 -k 1
04/29/2008... (1 Reply)
Hello Experts,
I am beginner to C language..
I know I am making a simple mistake but I dont know what the problem here
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
FILE* fh;
char s;
int i;
int count =10;
double a,b;
printf("COUNT=... (6 Replies)
Hiya all,
Newbie here - hope you can help
Trying to set up a login authorization on my website.
Reading away - it says works well with MySql database. Apache book goes onto to explain how to install Mysql etc....
But How do I set up the login page tho?
Please assist
Cheers... (5 Replies)