Fix errors for /bin/sh with the xtrabackup cron #1222
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using Debian's default shell for cron (
/bin/sh
), the xtrabackup incremental cron was failing for me with an error message like:This is caused by percent-signs (
%
) not being escaped. With/bin/sh
, percent-signs (%
) in the command, unless escaped with backslash , will be changed into newline characters, and all data after the first % will be sent to the command as standard input. Thus the EOF error.I also made another small commit to convert backtiks (`) into $(), which is the prefered POSIX way. https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 has a good writeup on it.
Happy to make modifications if required.