Disk quota which include database size
I've two centos 4.4 servers. On first, I've implemented disk quotas for users and its running fine. On other server, mysql is running.
I want to monitor the size of database also related to the user and if the size usage (disk quota+db size) reached certain limit, I can do some action (like mail).
for example, I've assigned 10MB disk quota to a user. So when the user has files totaling 8 MB and the database (having size 2 MB) then limit should be enforced or any action will be taken.
Currently, I've idea to create a script that will fetch disk usage by using "repquota" command, get size of database from other server using "show table status" command and then calculate total size and implement the action.
Is it correct way to do this thing. Plz give your advice/ hint if there is more better way to implement the same.
thanks & regards,
ek chota mota hindustani