The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page