Need to monitor directory change, and perform action
Question: 1st of all: I'm not programmer, neither Linux guru, just have to work with
Linux, Oracle, shell scripts.

My current task is to monitor a table in Oracle (tool: sqlplus), and if it
contains a certain row, then watch a linux directory for a growing tmp file,
and log its attributes (e.g. `ls -l`), in every 5 second.

The most important part is: this tmp file will be deleted if the above record
is deleted from the oracle table, and I need the last contents of this tmp
file.

I can't control the Oracle data, just got query rights.

The available tools are: bash, awk, sed, some old version of perl, ruby (not
1.9*), and python (2.5). I don't have install rights, so most of the outside
libraries are not accessible. I know I can run some libraries from my $HOME,
but I don't have internet connection on that machine: so can't download any
library.

Inotify is not available (older kernel).

Any idea where to start/how to do it? Thanks in advance.


Answer: How about creating a hard link in another directory, then, when the file
"disappears" in the original location, the hard link will still have access to
the content.

