No need for a script, a simple one-liner is enough. I'm using the -b parameter all the time without any issues.
Just enter this line into the GAiA job scheduler and have it executed at midnight:
. /opt/CPshrd-R??/tmp/.CPprofile.sh; mdsstop; sleep 120; /opt/CPmds-R??/scripts/mds_backup -l -b -d /var/log/mdsbackups/ 2>/dev/null; sleep 120; mdsstart -s
Manually create the folder /var/log/mdsbackups and use another one-liner to clean up the number of mds_backups in it:
ls -tl /var/log/mdsbackups/*.tgz | tail -n +10 | xargs rm -f
Additional info: How to reduce the size of mds_backup file (sk103115)