I would like to know if it is possible to run a script whenever a new file gets written to a directory?
Ideally the script should run say a couple of minutes following the writing of the file and if multiple files have been written during that time the script should only run once.
Is that possible on the RPi4?
The directories I want to monitor are located on a USB connected large NTFS formatted drive (1 TB).
If possible the monitoring should only watch specific file types being written (*.cpp, *.pas, *.mp4 etc)
And the monitoring should run even when noone is logged on to the system.
(Because file writes may be done via the samba share)