sftpgo-mirror/examples/quotascan
Nicola Murino 41a5b7007e
Some checks failed
Code scanning - action / CodeQL-Build (push) Has been cancelled
Docker / Build (alpine, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (alpine, true, ubuntu-latest) (push) Has been cancelled
CI / Test and deploy (1.22, macos-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, ubuntu-latest, true) (push) Has been cancelled
CI / Test and deploy (1.22, windows-latest, false) (push) Has been cancelled
CI / Test build flags (push) Has been cancelled
CI / Test with PgSQL/MySQL/Cockroach (push) Has been cancelled
CI / Build Linux packages (aarch64, ubuntu18.04, go1.22.6, arm64) (push) Has been cancelled
CI / Build Linux packages (amd64, ubuntu:18.04, go1.22.6, amd64) (push) Has been cancelled
CI / Build Linux packages (armv7, ubuntu18.04, go1.22.6, arm7) (push) Has been cancelled
CI / Build Linux packages (ppc64le, ubuntu18.04, go1.22.6, ppc64le) (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Docker / Build (debian, false, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (debian-plugins, true, ubuntu-latest) (push) Has been cancelled
Docker / Build (distroless, false, ubuntu-latest) (push) Has been cancelled
update links to the documentation
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
2024-09-18 18:47:20 +02:00
..
README.md update links to the documentation 2024-09-18 18:47:20 +02:00
scanuserquota add basic REST APIs for data retention 2021-09-25 12:20:31 +02:00

Update user quota

⚠️ Since v2.4.0 you can use the EventManager to schedule quota scans.

The scanuserquota example script shows how to use the SFTPGo REST API to update the users' quota.

The stored quota may be incorrect for several reasons, such as an unexpected shutdown while uploading files, temporary provider failures, files copied outside of SFTPGo, and so on.

A quota scan updates the number of files and their total size for the specified user and the virtual folders, if any, included in his quota.

If you want to track quotas, a scheduled quota scan is recommended. You can use this example as a starting point.

The script is written in Python and has the following requirements:

  • python3 or python2
  • python Requests module

The provided example tries to connect to an SFTPGo instance running on 127.0.0.1:8080 using the following credentials:

  • username: admin
  • password: password

Please edit the script according to your needs.