Open Dimama opened 6 months ago
I've found a workaround to solve this problem in my case: set -e flag to bash
command: ['/bin/bash', '-e', 'dump.sh']
instead of command: ['./dump.sh']
Thanks for the praise. Please add a pull request.
Best regards,
Andrew.
From: Дмитрий Мельников @.> Sent: Thursday, April 18, 2024 9:27:59 PM To: Martlark/pg_dump @.> Cc: Andrew Rowe @.>; Mention @.> Subject: Re: [Martlark/pg_dump] Handle exit code of dump.sh to effective use in kubernetes (and more) (Issue #20)
I've found a workaround to solve this problem in my case: set -e flag to bash
command: ['/bin/bash', '-e', 'dump.sh'] instead of command: ['./dump.sh']
— Reply to this email directly, view it on GitHubhttps://github.com/Martlark/pg_dump/issues/20#issuecomment-2063641246, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA6JUB5FSXBUTUROHSMAPDDY56U37AVCNFSM6AAAAABGNBQLVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRTGY2DCMRUGY. You are receiving this because you were mentioned.Message ID: @.***>
@Martlark hi Really appreciate your solution for database dump. Very handy and well documented
I use it to run as kubernetes cronjob (configuration simplified)
It works great, but in case of some error inside dump.sh i got only error message and script return 0 exit code which interpreted by kubernetes as succeeded
I suggest to add handle exit code of main operations inside dump.sh and return error code in this cases as dump.sh result I believe this solution will help to increase effective number uses cases of your solution
If you like my suggestion, I can present my solution via Pull Request