Can someone suggest/write a script that limits the file size in terms of MB/GB that each user on our video share server could upload per month. Client (a) pays 10.00 per mo.and is limited to upload a total of 900 MB per month vs Client (b) that is paying 50.00 per month and is limited to upload 8 GB per month. The video encoding process is very cpu intensive to the point of really slowing down the server when 10 or more users simutaneously are encoding their videos. There maybe a better way to resolve this then limiting the file size so if you can suggest what else may work in this situation I really appreciate any and all suggestions. Server Specs Cento 5 c-panel Dual Quad Core 2.0 ghz 6Mb Ram 1TB HDD 2 TB of BW
It's easy to write a script that allows users to upload or download xxxxxxxx bytes a month... if you have more details PM me!
Once they've uploaded their videos, you no doubt create a database entry with information about it, including author, filesize and upload time (presumably in UNIX form.) A simple query which would do the following is ideal: $month = now()-(30*86400); Select SUM(filesize) FROM `db` WHERE `authorid` = 4 AND `uploadtime` > $month; Something along those lines, my SQL isn't great so check it all up. Author id is obviously an example.