Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simonwep/cleanup-files

๐Ÿงผ Small utilities to cleanup directories such as download which are all the time full of random stuff.
https://github.com/simonwep/cleanup-files

cleanup-script exe executable scripts-cli tool util utility utility-application

Last synced: 20 days ago
JSON representation

๐Ÿงผ Small utilities to cleanup directories such as download which are all the time full of random stuff.

Awesome Lists containing this project

README

        


Logo


Quickly clean up chaos


Build Status
Download count
Current version
Support me

### Usage

> Disclaimer:
> This project was intended to check out rust and learn its concepts and principles. The code is kept simple and I've re-invented a lot
> to learn how it works (I'm aware of libraries such as [`clap`](https://github.com/clap-rs/clap) and [`structop`](https://github.com/TeXitoi/structopt) to build CLIs)

You can find the latest release [here](releases), keep in mind that some commands may not exist in older versions.

```bash
$ ./cleanup -h
```

```
Usage: cleanup [options...]

Flags:
-d, --dry, --dry-run Performs a dry-run, e.g. nothing get's moved.
-h, --help Prints this help text.
-v, --version Prints the current version.

Arguments:
-l, --log-file Creates (or disables) a log-file in the target folder. Default is 'c
leanup.log'.
-i, --include Move only files with one of the following extensions.
-e, --exclude Exclude certain files by their extension.

Values:
Source directory. Default is the current directory.
Target directory (Default is source + .archive).
```

### Examples

| Command | Explanation |
| ------- | ----------- |
| `./cleanup` | This will create a new `./.archive` in the current director and move all files (except these which start with a dot and the executable itself) into `.archive/[extension]/[file].[extension]`. |
| `./cleanup . etc` | It'll still use the current dir as source (`.`) but will move the files into `./etc` instead of `./.archive`.|
| `./cleanup -l --ext mp3,iso` | A `cleanup.log` file will be created inside of `./.archive` with information about what has been moved. Files with the exension `mp3` and `iso` are ignored and won't get moved. |
| `./cleanup ../ ./bam --log-file ../my-log.txt` | Grabs file from the parent-directory and moves them into `./bam` (the current directory). The log-file will be create in the _
current_ directory and is this time `my-log.txt`. |

### Building

This project is written in [rust](https://www.rust-lang.org), clone it via git:

```bash
$ git clone https://github.com/Simonwep/cleanup-files
```

Afterwards you can either run `cargo build` or `cargo test` to test the project.