What is safe-rm?

Safe-rm is a safety tool intended to prevent the accidental deletion of important files by replacing /bin/rm with a wrapper, which checks the given arguments against a configurable blacklist of files and directories that should never be removed.

Users who attempt to delete one of these protected files or directories will not be able to do so and will be shown a warning message instead:

    $ rm -rf /usr
    Skipping /usr

(Protected paths can be set both at the site and user levels.)

Recovering important files you deleted by mistake can be quite hard. Protect yourself today by installing safe-rm and reduce the likelihood that you will need to contact a data recovery service!

from Google Code (Linux/UNIX source code).

2008-06-09

safe-rm 0.2 released

After going through the feedback I received about safe-rm 0.1, I decided to cut a new release with a number of enhancements and bug fixes including:
  • support for system-wide protected path list
  • support for user-specific protected path list
  • fix for infinite loops before using the "real" rm
Packages for safe-rm are now available in Debian and Ubuntu.
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License.