Cron Job Question

Cron Job Question

Post by imanahmad » Sat, 05 Jul 2003 11:35:15



I have a question about the use of cron job. I understand that it
executes a process at a certain schedule, but is there a way to execute
a process once there has been a change in a directory or file? If so,
how would one do such thing? If not, what can be done to execute a
process once a change has been made in a directory or file?

--
Posted via http://dbforums.com

 
 
 

Cron Job Question

Post by $p1r17u4l_gyn3c0l0g.. » Sat, 05 Jul 2003 13:17:02



> I have a question about the use of cron job. I understand that it
> executes a process at a certain schedule, but is there a way to execute
> a process once there has been a change in a directory or file? If so,
> how would one do such thing? If not, what can be done to execute a
> process once a change has been made in a directory or file?

I'd suggest you write a script that checks the checksum of a file against a
record of the checksum, and then then takes action accordingly.  If the
file checksum is unchanged, it would exit.  If the file checksum has changed,
it would write the new checksum to it to a file in /var/tmp/filenamechecksum,
and execute the script you desire.

This "checking" script could be run from cron as often as you like.  

HTH.

--
.............................................................................

      The true measure of a man is how he treats someone who can do him
      absolutely no good                                  
                                                    - Ann Landers

.............................................................................


 
 
 

Cron Job Question

Post by Frank Cusac » Sat, 05 Jul 2003 16:22:58



Quote:> I have a question about the use of cron job. I understand that it
> executes a process at a certain schedule, but is there a way to execute
> a process once there has been a change in a directory or file? If so,
> how would one do such thing? If not, what can be done to execute a
> process once a change has been made in a directory or file?

a) see if your system has fam
b) search google for swatch

/fc