HOKAY!
So quotas for MySQL isn't going to happen tomorrow (/sad panda) so in the mean time, I've been checking sizes from time to time to see what people are using.
Very proud of my customers, no-one (thus far) has tried anything crazy like. But if you would like a report on your users, add this little script I wrote yesterday.
This may, or may not, be suitable for your current setup. If you have suggestions, I would love to hear them
Add your script to a cron job so you get an email about the details, and set it for once a day, once a week, once a month - whatever you like :-)Code:#!/usr/bin/perl chdir '/var/lib/mysql'; %checked; @list = `ls -1F`; foreach (@list) { next unless (/(.+)_(.+)\// && !$checked{$1}); print "$1\t"; $checked{$1} = 1; print `du -hc $1_* | tail -n 1`; }
I make no warranty for the accuracy on the generated report, if it breaks your system I will not be held responsible. If it does break your system, I suggest firstly calling your local poisons emergency centre, following by running around screaming your own name and begging for salvation.
PS. I highly doubt this could hurt your system in anyway. Just thought I'd add that for shits and giggles.
Outputs all current users and their database sizes (it groups them together for you), as I mentioned, set it up as a cron job and have cron email you the results.



LinkBack URL
About LinkBacks
Reply With Quote





