Large files are transferred to a server for processing. The server monitors a specific directory using incrond and when a new file is received the processing script is executed for that file.

Because the files are large it takes some time to transfer them. How do I make sure that the file has finished transferring before process it?


1 Answer 1


Your problem has nothing to do with scp. It's related to inotify, the kernel interface that's used to trigger an action on file system events. And you're apparently triggering on the wrong event. Read the man page of incrontab to understand how the system works.

If your processing script already triggers when the file has not been complete, I assume you trigger on the IN_CREATE event. You can change the corresponding entry in the incrontab to trigger on IN_CLOSE_WRITE.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .