[owncloud-devel] File System Usage Calculation

Ryan Hoshor ryan at ccwis.com
Wed Apr 23 20:16:36 GMT 2014


Hello everyone,
	I posted this on the public forums, but was directed to post it here, so I am just copying from my post here: http://forum.owncloud.org/viewtopic.php?f=26&t=20857&p=58502

I am attempting to write a script that will calculate the usage of every person's account for internal billing purposes. I have a bash script that calculates the actual disk space used on the storage backend, but that is sort of clunky for what I need. I used the following SQL to try and calculate, but am getting incorrect results:


      SELECT
         oc_storages.id,
         oc_filecache.storage,
         SUM(oc_filecache.size/8589934592) AS size
      FROM
         oc_filecache
      JOIN
         oc_storages
      ON
         oc_filecache.storage = oc_storages.numeric_id
      GROUP BY
         storage


Any ideas where the 'settings/templates/personal.php' file gets it's information from, or how to access that info for each and every user of the system?


<?php
    // From settings/templates/personal.php
    print_unescaped($l->t('You have used <strong>%s</strong> of the available <strong>%s</strong>', array($_['usage'], $_['total_space'])));
?>


Thanks in advance!


Thanks,
--
Ryan Hoshor ~ Systems Administrator
computerconnections
wiconnectwireless
(608) 524-2610 ~ www.ccwis.com




More information about the Devel mailing list