Asbackup return code on failure

When an asbackup fails, is it guaranteed to return a failure code (e.g. non-zero), and will it always return 0 on success? We have a customer who wants to backup the database on a schedule and be notified when a failure occurs. We plan to write a wrapper script for them that checks the return code and alarms on a failure.

Thanks, Douglas

Most of the failure gives error code. But some errors just give error messages with return code as 0. E.g. while running asbackup if one node goes down then asbackup gives error message and completes with less number of record with return code as zero. So you can’t rely on error codes for alarm.

Is there any way to achieve our desired result by parsing the text of the response? Is there a common word or phrase that appears when an error occurs? Or potentially a small set of phrases?

asbackup is printing error message with success in different situations. All these type of errors are printed in two different categories.

One is security violations for which following errors you will get in backup output but return code as zero:
Security error: AEROSPIKE_ROLE_VIOLATION:(error number)

For all other error in which backup gives error message with return code as zero has following format: Aerospike getmany failed, error (error number)

We can fix this by returning error code for these type error. Mean while you can parse above two error messages.

Thanks much appreciated!