Hello,

I'm new to this list and have a problem configuring a traffic accounting
for virtual users stored in a MySQL database.
The Problem is that if someone deletes a file, the size gets subtracted
from the complete produced traffic.

For example:

Someone uploads two files and produces a traffic of 50,000 bytes.
Now he deletes one of these files which is 10,000 bytes.

Problem -> now his produced traffic is only 40,000 instead of 50,000 bytes.
Deleted files get subtracted from the traffic amount.

My user quota configuration:

> # User quotas
> # ===========
> QuotaEngine on
> QuotaDirectoryTally on
> QuotaDisplayUnits Mb
> QuotaShowQuotas on
>
> SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session,
> limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail,
> files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits
> WHERE name = '%{0}' AND quota_type = '%{1}'"
>
> SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used,
> bytes_out_used, bytes_xfer_used, files_in_used, files_out_used,
> files_xfer_used ftpquotatallies WHERE name = '%{0}' AND quota_type =
> '%{1}'"
>
> SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used
> + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used =
> bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3},
> files_out_used = files_out_used + %{4}, files_xfer_used =
> files_xfer_used + %{5}WHERE name = '%{6}' AND quota_type = '%{7}'"
> ftpquotatallies
>
> SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4},
> %{5}, %{6}, %{7}" ftpquotatallies
>
> QuotaLimitTable sql:/get-quota-limit
> QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

I'm not familiar to this configuration. I've got it from an tutorial. So
my problem is I don't know what these numbers exactly stand for.

In this case in "bytes_xfer_used = bytes_xfer_used + %{2}"
(update-quota-tally) must be a negative value?

Maybe someone could give me a hint what I have to do to solve this issue.

Thank you in advance!

Regards,
Daniel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
ProFTPD Users List
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html