I have a RHEL 7.9 server I'm using as a file server. It exposes an XFS partition over NFS for clients to mount and use. I am willing to use a different filesystem than XFS if need be, but I cannot escape using NFS.
I'd like to force a Recycle Bin so that accidentally-deleted files are recoverable. Most of the results I see when looking for how to do this under NFS are simply "you can't, use CIFS/Samba".
I thought I could maybe use inotifywait
to intercept file delete calls and create a hard link in a Recycle Bin directory to "save" the file from deletion, but it seems inotifywait runs after the file is already gone.