Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumedir Cleaner v0.1 *beta* #403

Merged
merged 6 commits into from Oct 29, 2020
Merged

Conversation

totti4ever
Copy link
Contributor

This script is made for cleaning up the consumption directory used for the consumedir service (which is also part of the default docker-compose file and sends files to Docspell which are copied or moved there.

What it does:

  • 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.

What it takes (parameters / settings)

  • Parameters
    1. URL of Docspell, including http(s)
    2. Username for Docspell, possibly including Collective (if other name as user)
    3. Password for Docspell
    4. Path to Paperless' consumption directory (or any directory which files shall be checked against existence in Docspell
  • Environment variables
    • DS_CC_REMOVE
      • true - delete files which already exist in the collective
      • false (default) - move them to the archive (see above)
    • DS_CC_UPLOAD_MISSING
      • true - uploads files which do not exist in the collective
      • false (default) - ignore them and do nothing

totti4ever added a commit to totti4ever/docspell that referenced this pull request Oct 29, 2020
@eikek eikek merged commit 60b2b43 into eikek:master Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants