Skip to main content

Getting Backup diskspace value

Comments

8 comments

  • nixuser
    PHP Warning: disk_free_space(): No such file or directory

    /backup directory exists on server?
    0
  • ebuka
    Yes Sir, it does
    0
  • nixuser
    The message indicates otherwise. Will the code (only for the diskspace) work if placed in a different file?
    0
  • cPanelMichael
    I have added the cpanel user to the root group(I have root previlage ),

    Hello @ebuka, This is not a recommended action due to the negative security impact. Can you provide some more background information about the need for this functionality? Particularly, what's the use case for providing the cPanel user with the ability to see how much space is available on the /backup partition? Note the following UAPI function is available to obtain account-specific resource usage:
    0
  • ebuka
    The message indicates otherwise. Will the code (only for the diskspace) work if placed in a different file?

    Thanks for your response. Yes the code works for "/" directory or "/home" which is where the user account resides. Thanks.
    0
  • ebuka
    Hello @ebuka, This is not a recommended action due to the negative security impact. Can you provide some more background information about the need for this functionality? Particularly, what's the use care for providing the cPanel user with the ability to see how much space is available on the /backup partition? Note the following UAPI function is available to obtain account-specific resource usage:
    0
  • cPanelMichael
    Hello @ebuka, Thanks for sharing the additional information. Here's the WHM API 1 function you can use to get the disk space usage for partitions on the server: WHM API 1 Functions - getdiskusage - Developer Documentation - cPanel Documentation Let me know if this is more suitable for what you are looking for. Thank you.
    0
  • ebuka
    Thank your Sir for your guide and sorry for getting back late. The WHM API will bring in additional over head which I am trying to avoid. I just want to access the server backup disk space value from a cpanel user domain. Some thing like www.domain.com/backupspace.php Also is it possible to call "Server Information"(see attached file) page from a cpanel user script since the page provides the server disk-space but requires logining in to cpanel. Thanks
    0

Please sign in to leave a comment.