Can't run backups immediately by CLI

Can't run backups immediately by CLI

by Susana L. -
Number of replies: 1

Hi,

I need to backup some thousands of courses in Moodle 3.9. This is a procedure that we use to do every year. And this year we are having some extra trouble on Moodle 3.9...

At this moment when I try to run /usr/bin/php admin/cli/automated_backups.php I simply don't get any course to be backed up.

Checking automated backup status...OK
Checking courses
Skipping deleted courses...0 courses
Running required automated backups...
... started 08:20:01. Current memory use 39.9MB.
Getting admin info
Automated backups complete.
Automated cron backups completed correctly
Execution took 0.118708 seconds

We have ~4500 courses and I know that most of the backups are scheduled for the next Thursday. I can check that on reports and on mdl_course_backups. But I just want to ignore that schedule (I have set on backups settings param "backup_auto_active" to Manual and "save to" a selected directory ) and I want the backups to run immediately.

When I try to interpret the automated backup (new) code I understand that the problem must be on backup_cron_helper.class.php get_courses($now = null) function (checking that function I see that the RUN_IMMEDIATELY parameter is nor passed and as stated as a comment there "Only get courses where the backup start time is in the past" ... but anyway I couldn't find many posts related to this problem so I assume I must be biased and missing something....

Another approach would be to truncate mdl_backup_courses (as I saw in another post) but I really don't like to mess with moodle db on production server... unless we find that's the only/best procedure to have the backups running (immediately)...

I hope someone had some similar issue and help me on this. I have some urgency on backing up those courses...

Thank you for your attention!!

Best,
susana

Moodle 3.9
Postgresql 

Average of ratings: -
In reply to Susana L.

Re: Can't run backups immediately by CLI

by Susana L. -
Well, no one had a similar issue... smile

What I did:
I had to delete all entries from mdl_backup_courses and choose a closer date to finally get the backups done.
I also changed \core\task\automated_backup_task on https://[mymoodlesite]/admin/tool/task/scheduledtasks.php from every 50min to 15min in order to run it more closely to the scheduled date.

Best!
Average of ratings: Useful (2)