Originally posted by imanahmadi
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?
What kind of change are you talking about? If your waiting for a directory or file to change then create a script that creates a parameter file that gets updated when the file is updated. Say 0 means not updated and 1 means it is, when it is set to 1 run the other process from the script.
You can check if the file is updated doing a du -sk on the filename, if this greater then up date the parameter file.