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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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