I have files stored on an NFS mount which I want to prevent being deleted. The use case is I have a demo version of a web application which uses the same images on every demo - when someone deletes a record it deletes the associated images, files etc but I don't want these images to be removed as they are used by everyone. They should be able to delete other images etc but just not the ones I choose.
Previoulsy they were on local disk and I used:
chattr +i file
which worked a treat - I moved all the ifles to NFS and when I try this I now get:
chattr: Inappropriate ioctl for device while reading flags on file
At the moment I have a cron which runs every 15 mins and copies those files from an alternate directory back into the correct location which works but it is not ideal especially as it means that people signing up for a demo may see missing images inside that time window which looks rubbish. I could rewrite the application logic if I was really pushed but was hoping for something at a file system level which might work instead.
This reply (https://unix.stackexchange.com/a/90369/86224) suggested enabling ACL's but I am unable to do that and I cannot seem to get chmod to stop the files from being deleted:
-rw-r--r-- 1 owner owner 24751 Dec 23 16:30 file.ext
Is there an alternate way on NFS to stop a file being deleted?