So, in looking for a way to find out when a file is done being created to start the copy, I found inotifywait, but it doesn't seem to be working for me.
I'm using Redline to dump a remote computer's memory, and have the script so that it can find the right directory and file, but when I try to set up inotifywait, it just hangs and never returns that file is complete (I'm wondering if the file is held open by Redline until it's done with the whole scan, even though the actual memory image is done?)
I've tried
inotifywait -m -e create fileName
and
inotifywait -m -e close_write fileName
But neither seem to be working. They say watches created, but then just hang there long after the file isn't being written to anymore. And I don't know how to check to see if the remote machine still has a handle open on the file... cp certainly still works, and tail -f shows clearly that the file isn't being written to. Is there an elegant solution to notifying my script of the file being ready to copy over?