Thanks for looking over this project.
We have a system that is multi-user capable with each user account as a seperate Mysql database. Samples below are example only. I will give specific database & table names once a coder is chosen.
DATABASES:
system_user_1
system_user_2
system_user_3
and so on - "system_user_" is a constant
TABLE:
The table name is all the same ...
sample_table
AGAIN THE NAMES ARE JUST SAMPLES!
What I need is for the script to be executable from SSH command line or cron as root. It will find all the user databases grab the total number of lines of the specific table then add the entries up and email me the total count for the entire system.
The system adds databases incrementally but when a user is deleted that user number is not reused. I.E. ...
system_user_1
system_user_2
system_user_3
ect
When a user is deleted the databases will no longer be incremental. I.E. if user 2 is removed the system the db list will look like:
system_user_1
system_user_3
ect
Don't know if this matters but figured best to mention it.
We assume it would need to access the mysql main db and grab the users db list from the db table.
Once that's done it would access each user db and get the table line count, go to the next user db grab that count, add it to the first and cycle through until it has all the counts. Once all db's have been processed it'll email me the total for the entire system.
We am open to suggestions on how this would be best accomplished. As always don't hesitate to ask questions.