by Ken Task.
2 things:
1st gone away does indicate max_allowed_packet increase and you did that, but did you restart the mysql service for that change to take affect?
mysql> show variables like 'max_allowed_packet';
2nd:
/home/elearnadmin/moosh/moosh.php: call to Moosh\Command\Moodle23\Course\CourseBackup->execute()
moodle version is 3.9.6 but moosh version is version 23?
what does moosh -v return?
or moosh -n --list-commands |grep course
That version of moosh didn't have a course-backup command me thinks.
So me thinks you need to upgrade moosh.
'SoS', Ken