Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 examining the Monastery: (8)
As of 2014-08-23 03:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (171 votes), past polls