Hi Team,
when i was taking backup of couchbase buckets i am getting the progress bar status of messages like how much completed backup. Is there any way to suppress to discard the progress bar while take cbbackup of bucket.
while taking backup the standard output screen is getting filled with hashes like below because of this i am getting some memory issue while running my bash script.
My end goal is to capture error while taking bucket backups not the progress bar which comes in standard output.
###################################################################################################################################################
I’m guessing you’re running this directly rather than using the CAO backup functionality on kubernetes,
https://docs.couchbase.com/server/current/cli/cbtools/cbbackup.html
Looks like there is a --silent option. I’m not sure why you would be getting a memory issue with it though are you draining stdout so it doesn’t overflow?
Hi @Patrick_Stephens ,
The --silent option not helping to aviod the progess status its just used to display oly error but in my case i am getting standard output i.e progress status.
about memory issue i am using below command in my bash script
if errormessage=$(cbbackup $CBHOST directory -u $CBUSER -p $CBPASSWORD -b $bucket --silent 2>&1 );
the backup of bucket size is 20 GB
it trying to store the progress output in to that error message variable below error i am getting
./cb_dump.sh: xrealloc: cannot allocate 18446744071562067968 bytes
it throwing bash overflow error
Ah right, maybe ignore stdout then (e.g. redirect to /dev/null
and only store stderr? I’m not sure why you want it in a variable, a file output might be better even a temporary.
I’d have probably done it by checking the result of the command whilst forwarding to a log file to expose if it fails, e.g.
logfile=$(mktemp)
if cbbackup ... 2>&1 > "$logfile"; then
echo "Failed"
cat "$logfile"
exit 1
fi
rm -f "$$logfile"
or using just for local error output without stdout:
if cbbackup ... >/dev/null ; then
echo "Failed"
exit 1
fi
You could then redirect stderr as well if you want to a file or variable.
Easy enough to wrap in a generic function if needs be.