Check moodledata/temp/backup/ directory for directories that are named with a bunch of letters/numbers. Inspect one of those.
The last thing a backup routine does is to copy the built .mbz file to a location as set in backup preferences/automated backup settings. If in one of those directories you see a 'backup.mbz' file, that is a valid backup of that course, but your system could not 'copy' the .mbz to final destination.
There is a cron job that is supposed to clean up that area of moodledata. If there are directories present, might want to manually delete them .... to assure you don't run out of free space on partition where moodledata resides.
Me thinks this is an issue of DB user in config not having priv's to drop the temp table moodle creates when doing a backup.
mdl_backup_ids_temp ... is there a table by that name in DB?
Overtime database could need tweaking. Suggest intalling MySQL Tuner and run
the .pl script as superuser of DB server. Look at recommendations at bottom.
Note: you don't have to do all that is recommended ... so read up on recommendatons
and make decisions.
'SoS', Ken