# innobackupex return codes?

**URL:** <https://forums.percona.com/t/innobackupex-return-codes/2191>\
**Category:** Percona XtraBackup\
**Created:** [December 13, 2011, 10:58am UTC](https://forums.percona.com/t/innobackupex-return-codes/2191 "2011-12-13T10:58:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dchicks](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@dchicks](https://forums.percona.com/u/dchicks)\
**Post date:** [December 13, 2011, 10:58am UTC](https://forums.percona.com/t/innobackupex-return-codes/2191/1 "2011-12-13T10:58:51Z")

</div>

Does innobackupex return a useful code in the case of a backup failure of some kind?

I have looked for a list of return codes, but I have not found anything. It isn’t documented in the scripts “–help” feature, either. I’m not a Perl guy. So, trying to read the script didn’t help me any.

I’m using a PHP script to call the innobackupex script. I capture the return code from the exec() function and attempt to use it to handle any problems that might arise. For instance, I have a slave server that is failing to backup. Upon exiting from innobackupex, the SQL\_THREAD is still shut down. So, I need to restart it. It does not appear that the return code I capture is useful for this purpose, though. I would just like to verify if the innobackupex script returns a useful code before I spend too much time debugging my PHP.

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 14, 2011, 9:50am UTC](https://forums.percona.com/t/innobackupex-return-codes/2191/2 "2011-12-14T09:50:15Z")

</div>

I would have to look at the source to be sure. The exit function in the Perl code is what determines the return/exit code. Can you check and report back? We should document this.

---

<div class="post-metadata">

**Author:** ![dchicks](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@dchicks](https://forums.percona.com/u/dchicks)\
**Post date:** [December 14, 2011, 10:33am UTC](https://forums.percona.com/t/innobackupex-return-codes/2191/3 "2011-12-14T10:33:01Z")

</div>

I did have a quick look at the actual Perl code of the innobackupex script, but I admit I’m not a Perl guy. I could see that it appears to return the result of the “ibbackup” execution. Whether that includes all of the other things that innobackupex does is unclear.

I can only say this from my experience. I have a PHP script that launches innobackupex. I had been having a good deal of trouble with one of my slave servers due to a connection timeout. When innobackupex returned, the result code I got inside my PHP script was 0, despite the fact that the backup had a failure.

There were two implications arising from this. First, the SQL Thread for the slave was not restarted. I assume this is a bug. Second, my own PHP script did not let me know that the backup had failed. Fortunately, I’m monitoring this closely right now, since it’s all new to me.

Anyway, that’s why I wanted to ask about possible return codes. It seems that something isn’t getting reported as it should by the innobackupex script.

Thanks,  
Dave
