Skip to content

Commit fdea88b

Browse files
committed
Use gxargs on solaris
1 parent a3a0f09 commit fdea88b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/mysqlbackup.sh.erb

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ ROTATE=<%= [ Integer(@backuprotate) - 1, 0 ].max %>
2222

2323
# Create temporary mysql cnf file.
2424
TMPFILE=`mktemp /tmp/backup.XXXXXX` || exit 1
25+
<%- if @kernel == 'SunOS' -%>
26+
echo "[client]\npassword=$PASS\nuser=$USER\nmax_allowed_packet=$MAX_ALLOWED_PACKET" > $TMPFILE
27+
<%- else -%>
2528
echo -e "[client]\npassword=$PASS\nuser=$USER\nmax_allowed_packet=$MAX_ALLOWED_PACKET" > $TMPFILE
29+
<%- end -%>
30+
2631

2732
# Ensure backup directory exist.
2833
mkdir -p $DIR
@@ -61,7 +66,7 @@ set -o pipefail
6166
cleanup()
6267
{
6368
<%- if @kernel == 'SunOS' -%>
64-
gfind "${DIR}/" -maxdepth 1 -type f -name "${PREFIX}*.sql*" -mtime +${ROTATE} -print0 | xargs -0 -r rm -f
69+
gfind "${DIR}/" -maxdepth 1 -type f -name "${PREFIX}*.sql*" -mtime +${ROTATE} -print0 | gxargs -0 -r rm -f
6570
<%- else -%>
6671
find "${DIR}/" -maxdepth 1 -type f -name "${PREFIX}*.sql*" -mtime +${ROTATE} -print0 | xargs -0 -r rm -f
6772
<%- end -%>

0 commit comments

Comments
 (0)