How do I avoid Linux mistakenly deleting files?

Source: Internet
Author: User

Many of the work of the netizen on the operation of the positioning of the work, blame, "the blame"!
Enterprise operation and maintenance of more than 50% of the fault is due to internal personnel management errors caused by, "a process" is a typical example.
If you regulate every move in your work, you will continue to make mistakes, eventually leading to the futility of all the credit.
So the old boy teacher in more than 10 years of operation and maintenance work is how efficient operation, not let Ops become the blame?
Today we share some simple but effective tips to prevent accidental data deletion:
1, before you modify or delete data, be sure to back up, preferably with a different machine backup, modify the configuration and so on before the release management system is posted to the line.
2, the operation of the restoration of the deletion should use the MV command to replace the RM command, useless files do not worry about deleting, but moving to the Recycle Bin/tmp to observe a period of time.
You can block RM by setting up aliases, so that once you use the RM command directly you are aware of (of course, you can use the means to cross an alias).
3. If you do not want to delete data, you can also use find combined with RM to replace the simple RM, including set timed tasks such as actions to perform cleanup.
4, if you do not want to use RM Delete, please try to switch the directory in the deleted directory data, can not be used wildcard characters without wildcards.
5. If you do not want to use RM Delete and you want to take a wildcard character, follow these methods:
6, should prohibit the use of similar rm-fr/oldboy/ command Delete
7, if must be rm-fr/oldboy/
Command deletion, the last way to avoid the error is to use the TAB key to complete, do not hand knock any characters, prevent accidental deletion
8, if the deletion is not a directory, do not use RM-FR, the most rm-f method can be, or even important a small number of files, can not use-f, to obtain confirmation of deletion prompt information.
9. Add extra, use rsync--delete with caution
Summarize:
A. When data is deleted, most of the cases can be recovered, but will affect the business,
B. For example: the need for downtime recovery, and data loss, longer time users can not access the corresponding data
C. Recovery tools such as Ext3grep.
D. It is much better to prepare for a rainy day before it happens.
e. Develop norms, professional scientific operations and maintenance habits, operation and maintenance process is the key to avoid being the blame!

How do I avoid Linux mistakenly deleting files?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.