I need to write a script to repeatedly poll through a directory tree, find all newly modified files, and execute a command on each such file (say, encryption, archiving, etc.)
By "newly modified files" I mean files that were modified since last polled.
I specified "bash" tag, but it can be any shell (that runs under Cygwin).
I suppose I could rename files that have already been processed; but I wonder if there can be a cleaner solution.