I know that root can do anything, but is there a way to at least alert root that they are about to delete a folder that perhaps shouldn't be deleted?We keep a work directory in our /tmp folder, and from time to time an administrator will come along and purge the /tmp folder with roughly sudo rm -rf *. Is there a way to give something like a prompt or alert that they are about to delete a specific folder? Something along the lines of:The folder XXXXX is protected from deletion - do you really want to delete this folder? (y/n)I know, the best solution is to move this folder elsewhere (the /tmp folder is called temp for a reason after all!), but that has other problems. Hence my question.Asking this question makes me wonder, is it bad practice to actually blindly delete all the contents of the /tmp folder? Isn't a better approach to only delete files that are more than a certain age?
Give a warning when something is about to be deleted (by root)
permissions;root;rm
Moving your work folder is the solution. You're right that it is a little bit dangerous to wipe out files in /tmp blindly  normally, it's done either on system boot/shutdown or by using an access-time based deletion program (like tmpwatch).  But by its definition, the space volatile and it's not reasonable to expect otherwise.If you really want to prevent this, though, SE Linux could do it. You would give the directory a particular label, and configure it so that root doesn't normally have the unlink permission for objects with that label. This seems like significantly more work than just moving the directory to a better shared location, though  and since it causes an SE Linux audit message rather than the nice are you sure y/n prompt you're imagining, it seems like it'll eventually cause frustrating confusion.