473,732 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
+ 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 1465
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
2935
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 upload files, like this: copy ($myfile, $uploadfolder . "/" . $myfile_name); Everything works fine, it can process large files and everything, but i need to make sure that people only upload pictures, so i change
4
8134
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: ------------------------------------- test3.pl ------------------------------------- print "PERL Hello from Perl! (plain print)<br>\n"; print STDERR "PERL This is text sent to STDERR<br>\n"; $output="PERL Some output:<br>\n"; for ($i=0; $i<5; $i++) {
3
11118
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 returned value from a sql query and comparing it against the date. The two possible output types $ /usr/local/bin/sqsh -Uuser -Ppassword -S sql1 -h -i test.sql
2
2936
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 where there is no scripts allowed running (the software is from Opentext called Livelink)- therefore I need javascript to do the tasks listed below: 1. validate the form - this has been completed 2. pop up another window that will go ahead and...
9
2106
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 when the web site does XYZ, what SQL does it run on the DB2 database? Unfortunately everyone who knew about how it works has left and I've never even seen a DB2 database before today! So, I appear to be looking at an IBM DB2 Universal Database...
3
2168
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 PERL. So far, I have the javascript that does what I want to do, and it works fine as long as the the page was not generated by PERL. My problem is that when the javascript/html is generated by my PERL scripts the javascript never gets...
20
4281
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 is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
12
3167
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 file has the modified month and day matching today print message log is fine else the log is not updated and thats it. Now the script below I managed to parse to get both month and day for the files and the perl day and month now the script...
1
2932
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 CGI application misbehaved by not returning a complete set of HTTP headers. The scripts are very long but here are the opening statements: The One that works .... #!C:\Perl\bin\perl.exe # openresolver.cgi # # OpenResolver - a CGI script for...
0
8944
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8773
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9306
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9234
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6733
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6030
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.