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.

Backup - run a php script?

Discussion in 'General Discussion' started by sirchick, Dec 21, 2013.

  1. sirchick

    sirchick Registered

    Joined:
    Dec 21, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello,

    I am really new to this and also very confused on how to do what i am trying to do.

    I want to have my backup run, but before it does that run a PHP script which can update my database. I then want it to do something similar again when the back up finishes.

    This way users cannot login during backup... but i ain't got a clue how this i done, i've seen some people suggest i make my own PHP script and use cpanel crons to call that and just disable cpanel's backup.

    That would be alot simpler but if theres a way to do it with cpanel's backup it would save me writing an entire back up script.

    I'm not using legacy back up. Please help a noob :)
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    You can run cPanel backup using command
    /usr/local/cpanel/bin/backup

    If you start it from your own script remove it from root's crontab.
     
  3. sirchick

    sirchick Registered

    Joined:
    Dec 21, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    How do you call the command from a PHP script though ?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,808
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Your access level is listed as "Website Owner". To verify, do you have root access to the system? If so, you may want to consider using pre and post backup event hooks. Documentation on standardized hooks is available at:

    Standardized Hooks

    Thank you.
     
Loading...

Share This Page