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?
/tmp
? On some systems, it's just atmpfs
living in the virtual memory. You could hardlink the important files into another directory, so they stay there even if removed from/tmp
. – maaartinus Mar 01 '11 at 14:22root
when he tries to delete a certain folder (not necessarily in/tmp
). I edited the title, hope that helps. – phunehehe Mar 01 '11 at 15:49