sftpgo-mirror/examples/quotascan
Nicola Murino 00f97aabb4
OpenAPI: document that quota-update support partial updates
If the update mode is "add" and you pass only used_quota_size or only
used_quota_files the missing field will remain unchanged
2021-04-28 19:16:15 +02:00
..
README.md add an example script for scheduled quota updates 2021-04-26 21:53:09 +02:00
scanuserquota OpenAPI: document that quota-update support partial updates 2021-04-28 19:16:15 +02:00

Update user quota

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