I have multiple cameras sending images at random intervals via FTP to a predetermined folders.
For example:
recordings/camera1/images/ – for first camera
recordings/camera2/images/ – for second camera
etc
Each of them save images in .jpg format and then close FTP connection.
I need to call a PHP script after each time a new file is added. Let’s say whenever a new image is added into the /recordings folder I need to call the php script with
newimage.php?location=recordings/camera1/images/picture002.jpg
and so on.
The server is a Linux box running ProFTPD
How I can get this done?
Please note: Cron job is not an option as there will thousands of files and we are not using a DB. So we cannot find out if there are any new files.
I would advise you to take a look at the mod_exec of ProFTPD.
Here is a quote explaining its goal:
You can also take a look at inotify which offers you to monitor system file activity.