User Quota Mamangemt

Hello guys,
I have 20 user accounts which are supposed to be valid for 1 year 52w2d. Each user should have 15 GiB as a monthly quota limit and if user exceeds his/her quota rate should be reduced to something like 128k/128k until next month so that total download used will be reset to 0 . So after 12 months accounts expired.

Any help is really appreciated.
thank you in advance :smiley:

Any help?!!! :open_mouth: :open_mouth: :open_mouth:

I run postpaid with monthly quotas by utilizing a bunch of scripts based on those that can be found here https://wiki.mikrotik.com/wiki/AutomatedBilling

You can probably script to update one of the fields in the private information sections of the users profile daily with and incrementing number representing days they have been active and then disable the account when the value exceeds 365..

hello,

create profile in user manager, and limitation, and set group (name of new profile in hotspot user-profile).
of course you must set the validity in profile setting and not set transfer in limitation and nothing in rate-limit

then,
in hotspot user-profile script on-login set this rule:

{
:local upld [:tonum [/tool user-man user get $user upload-used]];
:local downld [:tonum [/tool user-man user get $user download-used]];
:local tr ($upld + $downld);
if ($tr > 16106127360) do={
/queue simple add max-limit=128k/128k name=$user target=$address;
} else {
/queue simple add max-limit=256k/1024k name=$user target=$address;
}
}
:local out [/ip hotspot get 0 interface];
/queue simple remove [find target=$out];

in log-out :
/queue simple remove [find name=$user];


the user will have rate-limit 256k/1024k but if he used the 15GB the rate-limit 128k/128k , you can change it in script if you want.

you can see this, it's arabic but you can understand by photos
http://max-upgrade.blogspot.com/2017/01/blog-post.html