473,473 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help with logic in creating perl script to monitor if files are being sent

154 New Member
how to monitor and find out if files test1_* and test2_* files were sent in an hour and if not send an email
This is on a unix system basically I got a cronjob that runs every sec polling a ftp dir which name dir1 and transfers the file to another server

So there are two types of files i want to check if are coming through and if they did not come through in an hour send an email.

so files test1_* and test2_* I am checking for.

Could somebody help me out with the logic.

The logic i am thinking is for the perl script
if test1_* or test2_* create date < time on server
then files are send ing within an hour
else files are not sending through

when 1 hour reaches and no files were sent in an hour send an email.


Could somebody help me out and let me know where i am going wrong withthe logic please.
May 7 '07 #1
1 1440
KevinADC
4,059 Recognized Expert Specialist
you would have to check if the creation date was within the last hour, not if it was just less than the server time.

if (creation date < server time and creation date > server time - 1 hour)

if you are using perls time() function

Expand|Select|Wrap|Line Numbers
  1. $time = time;
  2. if ($blah < $time && $blah > $time-3600) 
where $blah is the file creation time in epoch seconds
May 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tihon | last post by:
Hello! I again need your help, just can't understand whats going on. Got this upload pictures form and it's having problem handling large files (~1.5 - 2 MB). Everything works fine if i just...
4
by: Mark Wilson CPU | last post by:
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: -------------------------------------...
3
by: Stuart H | last post by:
Since bash is horrible at date statements i had to convert my bash script to perl....now i have a headache.. I had help to convert but now in modifying i have messed it up.. i'm checking a...
2
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server...
9
by: colin.mcnulty | last post by:
Hi, I'm a SQL Server DBA, but I guess that won't buy me any friends round here huh? ;-) I've been asked to look at the SQL that's being executed on a DB2 database from a web app, specifically...
3
by: Nathan Gilbert | last post by:
I am wanting to use javascript to select between different *.css files dependent on the user's browser. I am also wanting to generate the html document containing this javascript dynamically using...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
12
by: jonathan184 | last post by:
Hi the purpose of the script I am trying to do is to access a dir and run the ls -l command which will show the files and the modified date, no w the script is to check two files in that dir , if the...
1
by: vikjohn | last post by:
I have a new perl script sent to me which is a revision of the one I am currently running. The permissions are the same on each, the paths are correct but I am getting the infamous : The specified...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.