Automated Backup CLI

Re: Automated Backup CLI

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

One minute for *any* moodle cron/task job is probably too short ... too often.   Many cron jobs/task require more time to complete than 60 seconds allows.   Suggest something to the tune of 5 minutes might be more sensible.

Sorry ... don't understand that this means:

"But when all is done, i see that the files are very small, and when I go to the docs, I see that in Moodle 3+ 

the course files is not backuped."

There is no place, of which I am aware, that the Moodle UI as an Admin level user actually shows all the backup files.   There is, however, a report, that indicates if backups were successful and/or the status of automated backups.   Is that what you are referring to?   On your site: http://yoursite/report/backups/index.php

Have experienced this with one server.   Moodle tracks automated backups by writing info to 3 tables.   Since the auto backups were failing and I as attempting different combinations/options, was successful in getting a few courses backing up but a couple wouldn't complete when having the automated backups set to cron/task.  As a result the tables got messed up ... dates/etc. If your report shows next execution date/time in such a fashion that it will never complete this year (example, next execution set to June 5th and this is already July, you'll have to wait a year before that one might work.    So, as a result, I truncated the tables related: mdl_backup_controllers, mdl_backup_courses, and mdl_backup_logs.   Truncate means to leave the tables in the database just remove the rows in the tables - the tables contain no data.

That clears all tracking Moodle was doing for backups.   It is safe to do.

Then, I doubled checked settings to assure they were set to what I wanted, set automated backups to a sensible time... like 1 AM (not prime time) etc. then waited a day to check.   They finally ran and completed successfully and I've not had trouble with that server again.

'spirit of sharing', Ken