http://www.perlmonks.org?node_id=736784


in reply to Re^2: Synchronisation between multiple scripts
in thread Synchronisation between multiple scripts

Does your advisary locking of a pid file scheme, handle recovery after a system crash?
Yes.

If you review the mentioned thread, the first node by shmem details how the script should verify that the listed PID is actually running the proper script.

Polling directories is a silly way to do things.
Silliness is relative. If the files only need to be pushed to the server every hour, polling doesn't seem so bad.
How long do you wait after the filename appears, before you decide that the application writing that file has finished doing so?
How do you detect if the process writing the file has hung or crashed part way through writing it?
In the first approach, I specifically said "...to move files to the watched directory...." This is an important point; perhaps I should have explicitly stated that files should be moved to the directory rather than written to the directory.

Update: Corrected "rather than copied" to "rather than written" in the last sentence.

Update 2: Corrected HTML formatting of whitespace before update 1.