Listing accounts on mount points via API
Hi,
I have been looking to find a way to get a list of accounts on the various mount points. Account summary or list accounts give partition, but it's the least of what I need.
The file system is /mnt/cpuser1/acctname, /mnt/cpuser2/acctname, etc. Partition only gives "mnt". I know that I can use a bash script to get the various account names and then feed them to the API, but that seems like the clunky way. The information is available in the rearrange-account functionality of the WHM, but I can't even find the script for that page on the server to help me.
Hope someone has some info...
Thanks in advance,
Steve
-
Hi @DriveSafe There's no whmapi1 that will do this but you could essentially use the quota command for this, though you'd have to loop through all the users: [root@server ~]# quota -u lauren Disk quotas for user lauren (uid 1000): Filesystem blocks quota limit grace files quota limit grace /dev/vda1 1764100 10485760 10485760 41054 0 00 -
Hi @DriveSafe There's no whmapi1 that will do this but you could essentially use the quota command for this, though you'd have to loop through all the users:
[root@server ~]# quota -u lauren Disk quotas for user lauren (uid 1000): Filesystem blocks quota limit grace files quota limit grace /dev/vda1 1764100 10485760 10485760 41054 0 0
Thanks, Lauren. i ended up using this inside of the listaccts loop: exec('getent passwd '.$userdetails->{'user'}.' | cut -d: -f6 | cut -d/ -f3')0
Please sign in to leave a comment.
Comments
2 comments