by Bente Olsen.
Now it helps
I edited the shell script to:
cd /var/www/html/moodle/;
php admin/cli/maintenance.php --enable;
mysqldump -u moodleuser -p'pw' moodle > /var/www/moodlebu/mdldb-$(date +%Y%m%d%_-H%M%S).sql
ls -l ../../moodlebu/*.sql;
php admin/cli/maintenance.php --disable;
Unfortunately it does not use my underscore in the filename, but that is a minor thing.
During execution of the script it returns a warning:
Warning: Using a password on the command line interface can be insecure.
I think not to mention having a password stored in plain text in the system must be insecure, it must be better not to apply the password in the script?
Now I also think that it might be possible also to include backing up (cp -r) of the moodledata directory and the moodle directory as well?