What is safe-rm?
Safe-rm is a safety tool intended to prevent the accidental deletion of important files by replacing /usr/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 - for example:
$ 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!
Installation is simple and easy:
1: Download the package safe-rm-0.8.tar.gz from the following link:
http://code.google.com/p/safe-rm/downloads/list
2: Use the command which rm to determine the current location of the original rm command:
which rm
/usr/bin/rm
3: As you can see, this returned the path to the rm command as:
/usr/bin/rm
4: Now we need to un-archive this package with the following commands:
cd /usr/home/texasmike/Downloads (or the directory where safe-rm-0.8.tar.gz is saved)
tar -xvpf safe-rm-0.8.tar.gz
This will create the Directory safe-rm-0.8 within the current directory, and extract the files into that directory.
5: Copy/move the /usr/bin/rm original file to an alternate name for backup purposes.
sudo mv /usr/bin/rm /usr/bin/rm-original
6: Now copy/move the new safe-rm to the /usr/bin/ directory and rename to rm :
sudo mv /home/texasmike/Downloads/safe-rm-0.8/safe-rm /usr/bin/rm
(Use the appropriate path for the location of the extracted safe-rm file)
You will now be using the new safe-rm package when removing/deleting files by simply typing the command rm filename.
Once you have installed safe-rm on your system (look in the safe-rm-0.8 directory for the INSTALL file), you will need to fill the system-wide or user-specific blacklists with the paths that you'd like to protect against accidental deletion.
The system-wide blacklist lives in /etc/safe-rm.conf and you should probably add
paths like these:
/
/etc
/usr
/usr/lib
/var
The user-specific blacklist lives in ~/.safe-rm and could include things like:
/home/username/documents
/home/username/documents/*
/home/username/.mozilla
This will keep you safe when deleting files and/or folders, knowing you can not make an error and cause damage to the operating system.
Print this post
Visits on The blog
wibiya widget
U.E sites Links
U.E Search Engine
Search This Blog
Blog Archive
-
▼
2009
(9)
-
▼
November
(9)
- Ultimate Edition 2.4
- Ultimate Edition 2.4 Work in progress
- Ultimate Edition USB Style...
- Ultimate Edition HOW TOs
- HOW TO configure FireFox
- HOW TO protect against deleting files.
- HOW TO compile the kernel
- Ultimate Edition 2.3 Gamers has been released
- How to Install Adobe Flash Player 64-bit on Ultima...
-
▼
November
(9)
About Me
- ULTIMATE EDITION US - TexasMike
- I began using Ultimate Edition in October 2007. I have never enjoyed any OS as much as Ultimate Edition! Ultimate Edition is blazing fast and re-defines the Ultimate operating system. Click the Home icon and visit the Ultimate Edition site for more info about Linux.
Stealth XG
Category
- compile the kernel (1)
- compiz (6)
- FireFox (1)
- Gnome (7)
- Guide (1)
- KDE (6)
- Live DVD (9)
- OZ Unity (1)
- Synaptic (6)
- TexasMike (3)
- U.E (11)
- U.E Team (2)
- Ubuntu (9)
- Ultimate Edition (12)
- Ultimate Edition 2.8 (1)
- Ultimate Edition 2.9 (1)
- User (11)
1 comments:
Great blog ! good work !
Post a Comment