mirror of
https://github.com/TheAnachronism/docspell.git
synced 2024-11-13 02:31:10 +00:00
2.1 KiB
2.1 KiB
+++ title = "Directory Cleaner (⊗)" description = "Clean directories from files in docspell" weight = 150 +++
{% infobubble(mode="info", title="⚠ Please note") %} This script is now obsolete, you can use the CLI tool instead.
Use the cleanup
or the upload
command.
{% end %}
Introduction
This script is made for cleaning up the consumption directory used for the consumedir service (as it is provided as docker container)which are copied or moved there.
https://github.com/eikek/docspell/tree/master/tools/consumedir-cleaner
How it works
- Checks for every file (in the collective's folder of the given user name) if it already exists in the collective (using Docspell's API).
- If so, by default those files are moved to an archive folder just
besides the collective's consumption folders named _archive. The
archive's files are organized into monthly subfolders by the date
they've been added to Docspell
- If set, those files can also be deleted instead of being moved to the archive. There is no undo function provided for this, so be careful.
- If a file is found which does not exist in the collective, by
default nothing happens, so that file would be found in every run
and just ignored
- If set, those files can also be uploaded to Docspell. Depending on the setting for files already existing these files would either be deleted or moved to the archive in the next run.
Usage (parameters / settings)
Copy the script to your machine and run it with the following parameters:
- URL of Docspell, including http(s)
- Username for Docspell, possibly including Collective (if other name as user)
- Password for Docspell
- Path to the directory which files shall be checked against existence in Docspell
Additionally, environment variables can be used to alter the behavior:
DS_CC_REMOVE
true
– delete files which already exist in the collectivefalse
(default) - move them to the archive (see above)
DS_CC_UPLOAD_MISSING
true
- uploads files which do not exist in the collectivefalse
(default) - ignore them and do nothing