Skip to main content

Really, relentlessly and repeatedly remove files and all of their copies.

Project description

PyPI PyPI - License PyPI - Python Version

rrm

Really, relentlessly and repeatedly remove files and all of their copies.

Installation

The installation is straight forward. You can install the package via pip, pipenv, poetry and alike or by downloading the source from the gitlab repository.

From gitlab.com

To get the latest features or contribute to the development, you can clone the whole project using git:

git clone https://gitlab.com/szs/rrm.git

Usage

Delete files

To delete files and add information about them to a local database, type

rrm a_file.txt "another file.log"

Find exact copies of deleted files and delete them (not implemented yet)

To search a directory for files which have been deleted (and appended to the database) by to command above, type

rrm some_directory_with_obsolete_copies

Documentation

Please (for now) refer to rrm –help for documentation:

usage: rrm [-h] [-m [DIR]] [-d DB] [-r] [-i] [-I] [-n] [-H HASH] [-l] [-V] [-q] [-v] [-D]
         PATH [PATH ...]

Really, relentlessly and repeatedly remove files and all of their copies.

positional arguments:
  PATH                  each PATH is checked whether it is a regular file or a directory. If it is
                        a regular file it will be deleted or moved to DIR (see -m option), unless
                        -n is used, and added the the database. If it is a directory, the
                        directory is scanned for matches to the files in the database (not
                        implemented yet). Note that there is a huge difference between
                        'some_directory/' and 'some_directory/*'!!

optional arguments:
  -h, --help            show this help message and exit
  -m [DIR], --move [DIR]
                        move to a directory instead of deleting the files permanently. If DIR is
                        not set (but the option is used), $HOME/.config/rrm/deleted_files/ is
                        used. The directory will be created if
  -d DB, --db-file DB   the name of the database file. If DB does not exist, it will be created,
                        otherwise rrm will append to the file. If DB is a directory, rrm will look
                        for 'DB/.rrmdb.csv' and create the file if it does not exist. If this
                        option is omitted, rrm will use (and create if inexistent)
                        $HOME/.config/rrm/rrmdb.csv (default: $HOME/.config/rrm/rrmdb.csv)
  -r, --recursive       check for files to be deleted recursively. (not implemented yet) (default:
                        False)
  -i, --interactive     gather the files to be deleted, display them and ask once to delete all of
                        them.The files are only added to the database if the deletion is confirmed
                        (default: False)
  -I, --very-interactive
                        gather the files to be deleted, display them and ask for every file before
                        deleting it.The files are only added to the database if the deletion is
                        confirmed (default: False)
  -n, --no-action       gather the files to be processed, and only add them to the database
                        without actually deleting or moving them. (default: False)
  -H HASH, --hash-algorithm HASH
                        which hash algorithm to use. Currently supported are: sha1, sha224,
                        sha256, sha384, sha512, blake2b, blake2s, md5, sha3_224, sha3_256,
                        sha3_384, sha3_512, shake_128, shake_256 (default: sha1)
  -l, --follow-symlinks
                        whether to follow symlinks (default: False)
  -V, --version         show the version of this software
  -q, --quiet           switch off text output except for error messages. This will overwrite -v.
                        (default: False)
  -v, --verbose         more verbose text output (default: False)
  -D, --debug           switch on debug mode. This will show a lot of debugging information.
                        (default: False)

TODOs

Project

  • proper documentation

  • automated tests and CI

Basic features

  • process directories (i.e., look for file that match previously deleted files

  • process files in subdirectories (option -r)

Enhancements

  • add timestamps (UNIX epoch time) to the database entries, option to delete older than x or deleted before y

  • add check for user id

  • use sqlite instead of csv files for the databases, save hashes as integers

  • maintenance of database files: Listing, splitting, merging

How to Contribute

If you find a bug, want to propose a feature or need help getting this package to work, please don’t hesitate to file an issue or write an email.

Merge requests are also much appreciated!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rrm-0.1.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

rrm-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file rrm-0.1.1.tar.gz.

File metadata

  • Download URL: rrm-0.1.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.3 Linux/5.11.15-zen1-2-zen

File hashes

Hashes for rrm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c5ef11c8ce1ddd8fcca801631bf2cc655464880d38205a3df43c5c1bf474aa19
MD5 93621d2c0cfccc0979c7cec413615ca8
BLAKE2b-256 1082c8eb70e6eb82588ba1e70b9198a81e15f1fd655b53e9cc447c1483d82ae7

See more details on using hashes here.

File details

Details for the file rrm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rrm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.3 Linux/5.11.15-zen1-2-zen

File hashes

Hashes for rrm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e4ab2e0b10ad9ea6765f9ce6bbbb1350d9a6c36f7e13a2265279c273f3a4bbc
MD5 a80fc3f3961747bea7981c86b5c31420
BLAKE2b-256 35c0f4adc8de6d0b9b162e88db00d0f5ffc991d2f8857b27cd36e4f9f28c42f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page