OxnardMontalvo
Verified User
Ok, this is v.10 of my Shoutcast bandwidth tally program. It works like this:
1) Spin through all of the domains on the server and finds the ones with a content directory.
2) Read the /var/log/sc_serv.log file and make an array of all the files served for each domain.
3) Find the size of each file served.
4) Compute total bandwidth used for each domain (file size * hits)
5) Update each domain's bandwidth.tally with the number.
I run it in my logrotate script, you can also run it as a cron job. Make sure you only run it once per log file as it does not remove anything from the log file so it you run it twice, you'll tally the bandwidth twice.
Feedback is welcome.
=C=
p.s. standard disclaimers apply. Use at your own risk.
1) Spin through all of the domains on the server and finds the ones with a content directory.
2) Read the /var/log/sc_serv.log file and make an array of all the files served for each domain.
3) Find the size of each file served.
4) Compute total bandwidth used for each domain (file size * hits)
5) Update each domain's bandwidth.tally with the number.
I run it in my logrotate script, you can also run it as a cron job. Make sure you only run it once per log file as it does not remove anything from the log file so it you run it twice, you'll tally the bandwidth twice.
Feedback is welcome.
=C=
p.s. standard disclaimers apply. Use at your own risk.