On 16/01/15 10:02, Nigel Kukard via Users wrote: >> In addition I have a cron-job that checks if a user is close to the >> maximum quota and sends me a mail if so. I can then take the according >> actions, i.e., block the user if its obviously spam. I can provide you >> the script/query if needed - nothing fancy. >> > > Would be nice to include the script in a contrib/ directory :D
well, honestly its just a one-liner and an interim solution (which is now active for about half a year ;-). but here it is, feel free to extend it > echo "select TrackKey, FROM_UNIXTIME(LastUpdate) as LastSeen, Counter, > CounterLimit, Counter / CounterLimit * 100 as Percentage > from quotas_tracking left join quotas_limits on quotasLimitsID = > quotas_limits.ID > where Counter / CounterLimit > 0.5 and TIMESTAMPDIFF(HOUR, > FROM_UNIXTIME(LastUpdate), CURRENT_TIMESTAMP()) <= 1 order by counter desc;" > | mysql -u <user> -p<pwd> <database> parameters: 0.5 ... if counter is above 50% of the limit timestampdiff() <= 1 ... seen in the last hour if there are no results the output is empty, otherwise cron sends the result per mail ;-) as I said, not nice but it works... best, markus -- Markus Quaritsch E: [email protected] W: www.qwws.net P: +43 650 7997638
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Users mailing list [email protected] http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org
