Is there a way to see users data usage

Im new to owncloud, I have a server version 10.12.0.6, and i wish to see the data usage of my users or, at the very least, check the available free space on the server.
It seems simple task but i can’t figure it out

Hey,

i think you can gather this info on the command line via:

1 Like

This is some I also mis in Owncloud. Would be nice if I (the admin) could go to users and see how many diskspace is used/free for each users. Now only the user himself can check the used/free diskspace.

Please take a look at the impersonate app.

1 Like

Thanks for your answer.

I use Impersonate app but only with after asking permission of the user and only in extreem cases.
Would not be professional (and is not allowed) to view data of users without first asking their permission.

I do not want to see there files, I only want to check if a user is running out of diskspace.
So an option to select a “View occupied / free diskspace” would be very welcome in the users panel.

I see and understand.

Then you have to go with shell/scripting, as mentioned earlier.

1 Like

As this information might be of interest for me as well, I wrote a small shell script. It does the Following:

  • Gathers the information from your server, using the Provisioning API.
  • Looping through all users, and dumps the storage data to standard output.
user1
  total    : 5120.0 MB
  free     : 5040.1 MB
  used     : 79.8 MB
  relative : 1.56 %
user2
  total    : 5120.0 MB
  free     : 5115.5 MB
  used     : 4.4 MB
  relative : 0.09 %
user3
  total    : 5120.0 MB
  free     : 5112.8 MB
  used     : 7.1 MB
  relative : 0.14 %

You are welcome to adapt this script for your personal uses.

#!/bin/bash
# Dump user storage quota values
CLOUD="https://your_server"
CURL="curl -ns"
# In case the ~/.netrc file is not available, change like this:
# CLOUD="https://user:pass@your_server"
# CURL="curl -s"
USERDATA=$(mktemp -t 'ustoreXXXXXX')
NODE="element"

function setFilter {
    FILTER="s/${1}//g;s/[<>/ ]//g"
}

function megabytes {
    bc << EOF
    scale = 1
    ${1} / 1024 / 1024
EOF
}

setFilter ${NODE}
${CURL} ${CLOUD}/ocs/v1.php/cloud/users | grep ${NODE} | sed "${FILTER}" | while read USER ; do
	echo $USER
    ${CURL} ${CLOUD}/ocs/v1.php/cloud/users/${USER} > ${USERDATA}
    for NODE in total free used relative ; do
        printf "  %-9s: " ${NODE}
        setFilter ${NODE}
        VAL=$(grep "<${NODE}>" ${USERDATA} | sed "${FILTER}")
        if [ ${NODE} == "relative" ] ; then
            printf "%s %%\n" ${VAL}
        else
            printf "%s MB\n" $(megabytes ${VAL})
        fi
    done
done
rm ${USERDATA}

HTH
abu

2 Likes

Alfredb
Many thanks for sharing this script with us.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.