Hi, inside an ftp session i need to know if a file has arrive in the last hour, if not then send an email. the olders files on the remote server does'nt matter.
for $file ($ftp->ls){
push @files, $file;
}
for $file (@files) {
$localtimenoformat=time;
$mdtmnoformat=$ftp->mdtm($file);
unless ( ($localtimenoformat - $mdtmnoformat) > 3600 ) {
print "$file";
print "Localtime No Format = $localtimenoformat";
print "MDTM No Format = $mdtmnoformat\n";
}
envia_mail ();
}
$ftp->quit or die $ftp->message;
this print me the new files. this is not what i want, beside this evaluate all the files.
In short terms. if no file in the last hour send a mail. I'll appreciate if you point me to clear the idea
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|