Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Read, SFTP Put and Move Files from a "Busy" NFS FileSystem

by kschwab (Vicar)
on Jan 12, 2019 at 16:46 UTC ( [id://1228427]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Read, SFTP Put and Move Files from a "Busy" NFS FileSystem
in thread Read, SFTP Put and Move Files from a "Busy" NFS FileSystem

I suppose a poor man's subsitute would be to just stat all the *.xml files, sleep for 10 (30?) seconds, stat them all again, and skip any where the filesize has changed. Not perfect, but probably works most of the time. Probably more reliable than just processing any file more than 2 seconds old.

Another thought...use the Linux inotify() api so that you can be more event oriented. See Linux::Inotify2. Then, every time a new file is created in the directory, you get an event. That would keep you from having to scan the directory. Though, it would increase the risk of processing a "in-use" file, so you'd need pretty good logic to determine when the file is done being written.

Replies are listed 'Best First'.
Re^5: Read, SFTP Put and Move Files from a "Busy" NFS FileSystem
by salva (Canon) on Jan 13, 2019 at 16:26 UTC
    Does Inotify work for NFS? I think it only tells you about changes performed locally.
      Ah, yes, it would have to run on the NFS server...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found