Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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?
Jar. Jar!...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-09-19 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (229 votes). Check out past polls.

    Notices?