Congrats! Know that it's been an 'unpleasant' learning experience but you've internalized much in a short time and learned the most important lesson of backing up Moodle the easiest way.
From mysql docs:
If you change a global system variable, the value is remembered
and used for new connections until the server restarts. (To make a
global system variable setting permanent, you should set it in an
option file.)
Now might I offer little bash shell scripts to facilitate backups in parts? I have 3 that backs up code, the data directory, and the DB. Must manually create the backup directory. I usually use /home/backup/
As root user:
cd /usr/local/bin/
nano [nameofscript]
echo 'backupcode';
tar -cvf /home/backup/moodlecode-$(date +%Y%m%d).tar /var/www/html/moodle;
ls -l /home/backup/moodlecode*
echo 'backupdata';
tar -cvf /home/backup/moodledata-$(date +%Y%m%d).tar /var/www/moodledata;
ls -l /home/backup/moodledata*
echo 'backupdb';
mysqldump -u root -p[password] moodle > moodledb-$(date +%Y%m%d).sql;
ls -l /home/backup/moodledb*;
To do it all now, from any location, as root user, issue:
backupcode; backupdata; backupdb
If updating, upgrading or installing plugins just run:
backupcode;backupdb
'spirit of sharing', Ken