Skip to main content

rm-protection logo

rm-protection

A safe alternative for rm with minimum difference.

What is this?

rm-protection is a safe alternative for removing file. It works exactly the same as rm (in fact it passes arguments to rm). The only difference is that it refuses to procceed if a .*.rm-protection file is found and you failed to answer a question.

Quick Start

pip install rm-protection

  1. Install from PyPi and make an alias for rm-p.

  2. Protect your files using protect. If you want to protect everything inside, protect -R.

  3. Happy rm-ing!

How does it work?

It consists of two utilities: rm-p and protect. The latter one is to help you protect files.

For example, you have a file called important_file and it is protected by .important_file.rm-protection. rm-p will recognise that important_file is protected and prompt to ask you a question stored in .important_file.rm-protection. rm-p will only proceed if you get the answer right.

See it in action:

Basic usage

Basic usage

It will also prevent you from deleting a directory with protected file(s) inside.

Recursive protection

Recursive protection

Requirements

  • Python 2 or 3

  • Linux, unix and macOS

  • find

Known issues

  • Currently does not support protecting files whose name starts with “-“.

Comparison with alternative methods

Methods

Can be uesd as “rm”?

Protect Specific Files

Flexibi lity

Additional Files

trash-cli

Yes

Somehow

High

Centralised Config

rm -i

Yes

No or Somehow

High

safe-rm

Yes

Yes

Low

Centralised Config

rm-protection

Yes

Yes

High

One for each

rm-protection aims at providing maximum protection and flexibility while making minimum impact on daily operation.

rm -i can be very annoying, trash-cli is a bit complex (imagine you have a habit of emptying the trash without a second thought, or imagine you are trying to free up spaces on a budget vm). Safe-rm is inconvenient when you really need to delete something (you have to edit the configuration file).

Instead, rm-protection asks you a question set by you. You are fully covered when removing files (you won’t accidentally empty the trash with trash-cli or | yes with rm -i), and you can quickly remove files (without editing any configuration files).

How to contribute?

Pull requests and issues are all welcome! Or tell others about this, so you can even protect the files you send to others!

Metadata

Release files for rm-protection 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rm-protection 0.1.3
File Interpreter ABI Platform Actions
rm_protection-0.1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details for rm_protection-0.1.3-py2.py3-none-any.whl

Release files / rm_protection-0.1.3-py2.py3-none-any.whl

Download URL rm_protection-0.1.3-py2.py3-none-any.whl
Size 9.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
047414045bacfcaf0930cb47359fe76c39fbf147285dc55bfd202ef551250dbf
BLAKE2b-256 checksum
How to use checksums
40093cfd36832681293859bd95c8cb2c4d7cf8f1ec36382135289a568d266379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for rm-protection 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page