Skip to main content

Backup hook - success/failure test?

Comments

5 comments

  • cPRex Jurassic Moderator
    Hey there! In general, the postcpbackup file would only contain custom content as that isn't something that is created by cPanel by default. You'd need to further modify the existing script file to perform those additional functions, but I'm afraid I wouldn't have exact details on how to go about that. I know our standard backup notification does notify the server administrator email if the backup was successful, with something similar to this: [2021-09-01 02:17:36 -0400] info [backup] leaving queue_backup_transport_item [2021-09-01 02:17:36 -0400] info [backup] Completed at Wed Sep 1 02:17:36 2021 [2021-09-01 02:17:36 -0400] info [backup] Final state is Backup::Success (0)
    but that code wouldn't be able to be applied to a custom script.
    0
  • laxbobber
    Thanks @cPRex! Are you saying that cPanel will call postcpbackup but there's no way to know if the backup was successful other than determining which is the most recent log file and parsing it to look for "Final state is Backup::Success"? Maybe my question is best re-asked as: Is there a way to make cPanel NOT call postcpbackup if the backup has failed?
    0
  • cPRex Jurassic Moderator
    At this time I don't have any way to bail on the postcpbackup script if the backup itself failed - it just runs. This would be a good feature request to submit to our team using the link in my signature.
    0
  • laxbobber
    Thanks, I have done so. I added to a similar/related one here:
    0
  • cPRex Jurassic Moderator
    Thanks for getting that submitted!
    0

Please sign in to leave a comment.