-
I'm working on a script to watch a directory for new zip files, and to process them when they show up. I'm using ionotifywait like this: When I scp zip files into the directory the file isn't processed until the transfer completes. When I use copyparty to upload a file to the directory my script starts processing before the upload has finished. I guess maybe I need to use different events from ionotifywait to handle copyparty transfers? Anyone have any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Copyparty will open and close the file serveral times during the upload, so that makes sense -- copyparty's event-hooks can help, that's the most reliable way to perform an action after an upload has completed through copyparty. I'd suggest uploading the files to another folder when you're doing so with copyparty, and make a hook to move the uploads into your original folder when they're done; that should trigger the inotifywait. Or you could keep the two folders entirely separate, and use inotifywait-based events for sftp uploads, and have a copyparty hook perform the same actions for the copyparty folder. |
Beta Was this translation helpful? Give feedback.
Copyparty will open and close the file serveral times during the upload, so that makes sense -- copyparty's event-hooks can help, that's the most reliable way to perform an action after an upload has completed through copyparty.
I'd suggest uploading the files to another folder when you're doing so with copyparty, and make a hook to move the uploads into your original folder when they're done; that should trigger the inotifywait. Or you could keep the two folders entirely separate, and use inotifywait-based events for sftp uploads, and have a copyparty hook perform the same actions for the copyparty folder.