Monitoring remote ftp directory mounted by HA

I am banging my head off my desk trying to figure this out

I am trying to fire a gpio pin or script on upload of a picture to a remote FTP directory that I have mounted as on the HA server

I have tried inotifyutils and it does not see the upload event in the ftp directory, if I touch a file there, scripts fire, delete same thing, just not upload or any action take by ftp

So i figured I would script the ftp server to fire a rest call to a generic sensor and create actions from there. Well since this is on my firewall it is using vsftp which does not have this capability. I also cannot just install any packages on the firewall as it is a “controlled” package distribution which has custom packages made for it…

So now back to the HA, does anyone know how I can achieve this?

any sensors I can use?

TIA

The trouble with inotify is that it requires the local kernel to tell it about activity. That won’t work for actions on a mounted file system that aren’t performed from the local host.

I’d just write a (shell) script that you call, that walks the contents of that mount point and takes the appropriate actions.

AHH thank you, I suspected it had something to do with the directory being remote, I am trying to make this as real time as possible…

I may have found a solution in using swatch on the ftp sever to make the rest call when an upload is initiated.

working on that now.

if I did go the local script route I would have to monitor the directory every second to maintain the “real time” aspect

I will see how the swatch works out

Thanks for the reply!