I have a directory that gets written to when other machines send files via FTP. I want to put something in place that notices when files arrive and if their file name contains a particular substring (like "jpg"), move the file to some other directory (only after the file has finished arriving, not before)
I want to put this in place on many different kinds of Linux boxes. One such box has Linux kernel 2.4.22. It is possible there are older ones. I'm still checking.
On the older machines, I see this:
inotifywait: command not found.
I've also seen this:
The inotify API is available in Linux 2.6.13 and later
bash: watch: command not found
Ideas in POSIX sh or bash or C could work. Perl and Python are probably not available everywhere I want to run this. I don't have permission to install packages.