Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

UAPI as Root

Discussion in 'cPanel Developers' started by Victor Campos, Jul 14, 2016.

Tags:
  1. Victor Campos

    Victor Campos Registered

    Joined:
    Jul 14, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Peru
    cPanel Access Level:
    Root Administrator
    I need to run a script as root. The script duplicates the contents of one domain to another (Database, html, php, folders, etc)

    the script works, but I need to run it from a php.

    excuse my English, I speak only Spanish

    Thank you.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,806
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    How are you using UAPI in your custom script? You can define the username in a UAPI function using the command line per the example at:

    https://documentation.cpanel.net/display/SDK/Guide+to+UAPI

    You may have an easier time developing a bash script instead of a PHP script if you are only running it as the "root" user.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice