Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to retrieve files at least 5 minutes old using sftp foreign

by atcroft (Monsignor)
on Nov 06, 2013 at 18:12 UTC ( #1061458=note: print w/ replies, xml ) Need Help??


in reply to How to retrieve files at least 5 minutes old using sftp foreign

Take a look at Net::SFTP::Foreign::Attributes (included in Net::SFTP::Foreign)-it includes methods for looking at the atime and mtime of the files. Depending on if the machines' clocks are close, then something like the following (untested) snippet might do the trick (derived from the docs):

my $t = time; foreach my $f (@list) { if ( $f->{mtime} + 300 < $t ) { # retrieve $f->{filename} here } }

Hope that helps.


Comment on Re: How to retrieve files at least 5 minutes old using sftp foreign
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1061458]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-21 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls