1 safe-rm - http://www.safe-rm.org.nz
2 prevention of accidental deletions using a directory blacklist
4 Copyright (C) 2008-2009 Francois Marier <francois@safe-rm.org.nz>
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 Once you have installed safe-rm on your system (see INSTALL), you will need to
23 fill the system-wide or user-specific blacklists with the paths that you'd like
24 to protect against accidental deletion.
26 The system-wide blacklist lives in /etc/safe-rm.conf and you should probably add
35 The user-specific blacklist lives in ~/.safe-rm and could include things like:
37 /home/username/documents
38 /home/username/.mozilla
44 If you want more protection than what safe-rm can offer, here are a few suggestions.
46 You could of couse request confirmation everytime you delete a file by putting this in
47 your /etc/bash.bashrc:
51 But this won't protect you from getting used to always saying yes, or from accidently
54 Or you could make use of the Linux filesystem "immutable" attribute by marking (as root)
55 each file you want to protect:
59 Of course this is only usable on filesystems which support this feature.
61 Here are two projects which allow you to recover recently deleted files by trapping
62 all unlink(), rename() and open() system calls through the LD_PRELOAD facility:
65 http://homepage.esoterica.pt/~nx0yew/delsafe/
68 http://hpux.connect.org.uk/hppd/hpux/Development/Libraries/libtrash-0.2/readme.html
70 There are also projects which implement the FreeDesktop.org trashcan spec. For example:
73 http://code.google.com/p/trash-cli/