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.

Return codes of backup

Discussion in 'cPanel Developers' started by paszczak000, Feb 7, 2016.

  1. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    Hi guys,

    I want to write Hook to run after backup is finished. I need to get status code from backup (failed or not). How can I get it using Standardized Hook.

    I want to run one command when backup is done without errors and second one when its failed.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    That information is not passed to the hook scripts.
     
  3. paszczak000

    paszczak000 Active Member

    Joined:
    Nov 29, 2007
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Poland, Łódź
    So is any waf from Hook Script to check if backup failed or not? Maybe getting some details from logs?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    You could develop a script that searches for specific entries in the transfer logs that identify if the transfer succeeded or failed. These documents may help:

    Review Transfers and Restores - Documentation - cPanel Documentation
    Touch File for Additional Transfer and Restore Log Diagnostic Entries - cPanel Knowledge Base - cPanel Documentation

    Keep in mind that notifications are currently configurable for the following events in "WHM Home » Server Contacts » Contact Manager":

    Backup Delayed
    Backup Failed To Finish
    Backup Failure
    Backup Successful
    Backup Transport Error


    Thank you.
     
Loading...

Share This Page