New courses not added to table mdl_backup_courses

New courses not added to table mdl_backup_courses

by Alain Raap -
Number of replies: 32
Picture of Particularly helpful Moodlers

We have a problem that new courses are not backupped. When I look in table mdl_backup_courses, I don't see the new course id's in the table. Also attribute nextstarttime has different values instead of one value of the automated backup we start at 01:30 hrs at night. We've had some problems with big courses that took too much time to create a backup. We can't exclude them from the automatic backup task. Does the automatic backup stop in case of a course that isn't backupped completely?

Our Moodle version is 3.1.5+

Average of ratings: -
In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers
There is room for improvement with Autobackups ... think those are in the works, but with your current version, one might have to 'adjust'.

Sharing what I do ... not saying it's the only way and would work in your case ... here goes:

In mdl_backup_courses what does laststatus column show?
1 should indicate 'success'.

Table rows should match the course id's .. at least those that meet
parameters of the setup of automatted backups - which are?

Depending upon number of courses and their backup size (which one gets by looking
at any previous backups), one might need to stop automatted bsckups and
break apart large courses from medium to small courses - whatever that means.

Have a server where about 6 courses are multimedia - lots and lots of.
Had to do as I suggested above ... those 6 courses would kill auto.

So, created a simple course id file for 'largecourses' (one liners with nothing but course id number), then looped through large course backup bash shell script via admin/cli/backup.php .. id numbers executing the cli backup.php file with a designated destination for 'largecourses' on a "large' partition/mount point.

The other courses, ditto cept to something sane.

Cron jobbed the large backups to take place on weekends.
Cron jobbed the others for like Monday - 12 midnight.

Ideal?  Nope!  But it works! smile
'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Ken, we could shake hands smile I found the same resolution/strategy like you did.

As we have several large courses (> 2,5GB) I found out that one of the courses took 7 hours to complete (with the cli script via a cron bash script)! And a few others that caused other errors where the automated backup was broken .

I tested your truncate solution of the table mdl_backup_courses and that is also a way to get it working again. But that was not on our production site.

I am looking to implement a solution as you propose, just to exclude the courses that cause all these troubles. 

I hope the next version of Moodle (3.5.x) will have a better implementation of the automated backup process

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

Moodle 3.5.x automated backups in Moodle Admin, looks to be the same as in 3.4.x.
No finer controls to exclude certain courses by size of backup or by their ID numbers.
Same is true of CLI script for autobackups.

Ditto 3.6.x

So this issue, which is affecting more than one admin/site, hasn't reached threshold where it's revisited or improved in the Moodle Admin UI.   Maybe some Moodle Association member will 'spend' their votes on addressing the issue.

Didn't find anything on any Moodle Roadmap for future versions of Moodle, but that is sooooo easy to miss ... not find.

Until then, looks like truncating that one table that tracks and then running and/or one's own bash shell scripts are the only solutions for sites afflicted.

We have off-loaded cron jobs now ... wonder if an off-loaded autobackup would work ... or how it would work .. to relieve strained Moodle servers.   Just thinking out loud here! :|

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Thanks for thinking out loud Ken! I have the server where I truncated the mdl_backup_courses table up and running again and there the automated backup was running ‘normal’ again.

I did this in three steps:

- truncate mdl_backup_courses and wait until the table was recreated again with all the courses (laststatus for all courses = 5).

- I updated the table with laststatus = 1, start/endtime with a valid timestamp (endtime after starttime) and nextstarttime with the timestamp for the next nightrun

- the automated backup uses the parameters that are valid for the (nightly) batchrun 

This helped me to get it working again on one server (not the production server and with Moodle 3.5.4+!)

It’s not the ideal situation but a workaround to get the automated backup run back on track again.

Problem is the mismatch with the automated backup and courses that fail or take to long time to run. We can only try to exclude them manually from the ‘good’ courses. A bash script run by the Linux cron with the backup cli script was the only way to find out that a course was taking 7 hours for making a backup! These are the courses that cause a headache to administer this backup process.



In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Jerry Lau -

@ken..

How do you offload cron.php to another server? I thought that if even we can, it would still use the same database no? 



In reply to Jerry Lau

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

Yes, would have too ... not only same DB but same moodledata/filedir ... for sure.

So, yes, one would end up conserving web processes ... me thinks.

There was an older discussion/cussion about this ... turns out a load balancer (just 2 nodes) ... the 1st node where cron jobs ran ... the 2nd node handling all the day to day connections, etc. 

Now if I were you ... given the history of all the issues you have presently ... whose cause(s) is/are still un-known, don't think I'd jump out of the pan only to find myself in the fire! :\

'spirit of sharing', Ken


In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Ken, just thinking out loud, would it be possible to run a bash script against the automated backup php script?
I built a bash script that reads a file with course-ids, calls the backup cli script for each course-id  and that is
run via the Linux cron in the weekend. Only  that script doesn't look at the number of days of a course last
change in the parameters or the number of backups that must be present of each course. I'd like to find a
way to exclude the 'problem'  courses and to run the automated backup without the courses that make the run
fail each time.

This is the (simple) bash-script (file courses.txt contains the course-ids) to run a backup list outside Moodle cron;

#!/bin/bash
# ------------------------------------------------------------------------------
# Script: backup_moodle_courses.sh
#
# - Backup a list of courses with admin/cli/backup.php
#
# Writer:       Alain Raap
# Date:         24-01-2019
# ------------------------------------------------------------------------------
exec > >(tee -i /tmp/backup_moodle_courses.log)
exec 2>&1

# ------------------------------------------------------------------------------
# Set parameters
# ------------------------------------------------------------------------------
SCRIPT="backup_moodle_courses"
COURSES="/tmp/courses.txt"
COMMAND="$MOODLE_ROOT/admin/cli/backup.php"
PHP="$PHP_COMMAND_PATH"
BACKUP_PATH="/path-to-your-automated-backup-courses-map"

echo "${SCRIPT}: Start backup script"
# ------------------------------------------------------------------------------
# Read input file with course-id's to backup
# ------------------------------------------------------------------------------
while read COURSE_LINE ; do
   ID="$(echo ${COURSE_LINE} | cut -d',' -f1)";
   NAME="$(echo ${COURSE_LINE} | cut -d',' -f2)";
   echo "${SCRIPT}: Backup of course: " $ID " - " $NAME;
   echo "$PHP $COMMAND --courseid=${ID} --destination=${BACKUP_PATH}"
   $PHP $COMMAND --courseid=${ID} --destination=${BACKUP_PATH}
done < ${COURSES}

echo "${SCRIPT}: End backup script"
exit 0

Example courses.txt:

1500,Course A
1501,Course B
1502,Course C
1503,Course D

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

The automated backup script in code/admin/cli/ is pretty much all courses so no reason to attempt interfacing any bash shell.   However, backup.php is for single but can ...

Since I have other scripts for mysql queries etc. I got tried of trying to remember things for every server so started using mdlvars.txt for those scripts ... now I only have to edit mdlvars.txt and the other scripts work. smile

mdlvars.txt - non-executable - readable by root only.

# use checkvars first
# you must manually create the backup directories
# you must provide paths and values.
# paths do NOT have trailing slashes.
# be sure to include the variables between the ticks
mdcode='/var/www/html/moodle34'
mdpath='/var/www/moodle34data'
mddbuser=''
mddbpass=''
mddbname='moodle34ssl'
msbudir='/home/backup/m34'
mcbudir='/home/backup/m34/courses'
mversion='344+'

checkvars - made executable by root only ... viewable by root only

source mdlvars.txt;
echo 'mdcode Path to moodle code: '$mdcode
echo 'mdpath Path to moodle data: '$mdpath
echo 'mddbuser Moodle DB User: '$mddbuser
echo 'mddbname Moodle DB Name: '$mddbname
echo 'mddbpass Moodle DB Pass: '$mddbpass
echo 'msbudir Moodle Backup Directory: '$msbudir
echo 'mcbudir Moodle Backup Courses: '$mcbudir
echo 'Moodle Version: '$mversion

niclbackups - non-interactive backups - make executable by root only

#!/bin/bash

source mdlvars.txt
for i in $(cat ./cids.txt)
do
    echo 'Course ID in que:' $i;
    php backup.php --courseid=$i --destination=$mcbudir
done
ls -l $mcbudir;
echo 'Done!';

To get cids.txt built:

getcids - make readable by root only and executable by root only.

source mdlvars.txt;
mysql -u $mddbuser -p$mddbpass -e "use $mddbname;select id from mdl_course;" > cids.txt;cat cids.txt

edit cids.txt to remove the columns label and any course id you desire NOT
to backup ... like 1 - which is the front page.

cids.txt looks like:

3
4
5
6
2

One can have a cron job point to: niclbackups
One can copy niclbackups to different versions ... like a niclbackupslarge
and adjust the cids.txt listing for the cids of large courses.

For one run of all courses advise using nohup in conjunction with bash shell script .
https://linux.die.net/man/1/nohup

'spirit of sharing', Ken


In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Ken (and Jerry), here's another option I used for our messed up table mdl_backup_courses:

Save this query to an input file (for example query.sql), you can use your own timestamps for laststarttime, lastendtime and nextstarttime. Keep in mind that lasstarttime must be a timestamp before lastendtime and that nexstarttime must be the scheduled time of your automated backup settings (in my example 01:30).

use your-moodle-database-name;
select "TRUNCATE mdl_backup_courses;";
select "INSERT INTO mdl_backup_courses ( courseid, laststarttime, lastendtime, laststatus, nextstarttime) VALUES ( " , id , " , " ,  UNIX_TIMESTAMP('2019-03-05 08:05') ,"," , UNIX_TIMESTAMP('2019-03-05 08:10') , " , 3, ", UNIX_TIMESTAMP('2019-03-06 01:30'), ");" from mdl_course order by id;

The query generates an sql script that regenerates your mdl_backup_courses based on all the courses in mdl_course:

Run the query.sql on your database server with:

mysql -s -uyour-db-user -pyour-db-user-password  < query.sql ( > output.sql )

Example output.sql

TRUNCATE mdl_backup_courses;
INSERT INTO mdl_backup_courses ( courseid, laststarttime, lastendtime, laststatus, nextstarttime) VALUES (      1        ,      1551769500      ,       1551769800       , 3,   1551832200      );
INSERT INTO mdl_backup_courses ( courseid, laststarttime, lastendtime, laststatus, nextstarttime) VALUES (      2      ,      1551769500      ,       1551769800       , 3,   1551832200      );
INSERT INTO mdl_backup_courses ( courseid, laststarttime, lastendtime, laststatus, nextstarttime) VALUES (      3      ,      1551769500      ,       1551769800       , 3,   1551832200      );
INSERT INTO mdl_backup_courses ( courseid, laststarttime, lastendtime, laststatus, nextstarttime) VALUES (      4      ,      1551769500      ,       1551769800       , 3,   1551832200      );

...
...

Now load the output.sql with:

mysql -s -uyour-db-user -pyour-db-user-password  < output.sql

Your table mdl_backup_courses is recreated with the content of table mdl_course.

Average of ratings: Useful (3)
In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

@Alian ... EXCELLENT!  Thanks for sharing back!

Now for some more thinking 'outloud' ... moodle has a hidden health check tool which if errors/issues are found provides a solution as sql statements.

Since autobackups has been problematic for many, I wonder if a 'autobackups health check' tool could be created and the 'show solution' button would output the queries to fix?

Again ... thanks for sharing your DB expertise.

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

You're welcome Ken. And what might be a good tip I think, exclude (delete) the courseid's you find in the mdl_backup_courses table with laststatus = 2 (BACKUP_STATUS_UNFINISHED). Use for these 'problem' courses the bash script Ken described in this thread earlier.

In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Another point I forgot to mention with my script to recreate the mdl_backup_courses based on the mdl_course table content, make a backup (mysqldump) of this table before you truncate the table and insert the new records:

mysqldump -uyour-db-user -pyour-db-user-password moodle-database-name mdl_backup_courses > backup_mdl_backup_courses.sql

Restore the backup_mdl_backup_courses.sql with:

mysql -s -uyour-db-user -pyour-db-user-password moodle-database-name < backup_mdl_backup_courses.sql

You can also restore the last backup of your complete database, but this works faster, restore only the mdl_backup_courses table if necessary if you get into trouble with the recreated mdl_backup_courses table. It's always preferred not to test this on your production site if you don't know how Moodle (backup) will behave after this change of the automated backup!

In reply to Jerry Lau

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

Just thought  of another way to 'offload' cron **without load balancing** ...

clone the code directory to your dedicated DB server.   Apache server will not be used in running cli cron nor any of the cli scripts contained in code.   You would have to change the config.php file of the clone ... moodle checks and in this instance you could use superuser creds for DB.   A moodledata directory would need to exist ... one could use a mount point on the DB server that points to the real moodledata on the web server.

One ***never uses apache*** ... apache service isn't running ... use only CLI scripts ... NO browser.

Since, in your case, top/htop or whatever has shown your DB server is basically under-utilized memory wise one has much more resources available to cron than the balancing act one has to do on web server.

'spirit of sharing', Ken




In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

@Ken I also tried this option, to make a backup with a Moodle instance on the database server. It looked like it wasn't much faster, and I also see that writing the course-files to the filesystem is slow in my opinion. What is your speed when writing to disk in the temporary folder of Moodle? And did you tweak any configuration settings for this backup configuration (database or PHP)?

Just a tip before you try to configure/test this, if you're using a caching server (like Memcache or Redis) that's not installed on your database server, remove the caching server in the plugin configuration settings (Plugins -> Caching -> configuration in Admin). This will prevent errors in your PHP error log. Otherwise the backup script won't work.

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

Yes, writing to a mounted moodledata/temp/backup/ area would be slow - to be expected really.  But, the goal for Jeri was to offload autobackups from main server.  As long as DB server had enough umph to handle/finish autobackups speed not that much of a concern over finishing ... accurately.

I thought I had mentioned I had never tried it!   Got my little bash shell script solution and that works for the sites I admin sooooooo. ;)

But thanks for suggestions ... might need them one day!   Hopefully, Moodle might address the issue before then.

'spirit of sharing', Ken


In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

@Ken I just tested this option with one of our 'headache' courses, normally this backup took 7 hours to finish, on the database server with a Moodle instance and only PHP it took only 3 hours! So that's worth to take a look at smile
Main difference I think is that the backup script didn't have to write to an NFS share and that it runs on the same server as the data of Moodle. We have our webserver in a DMZ and DB server in BZ, connected via NFS share.

In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Ken, I found out that there is a field 'backupskip' in table mdl_backup_courses. Is this field used in the automated backup task?
If that's true, then this field could be used to skip the large courses and other problem courses. I couldn't find any documentation
here about this attribute.

In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Ken , some more info for you about the mdl_backup_courses:

 select FROM_UNIXTIME(nextstarttime) as nextstarttime, count(id) as courses from mdl_backup_courses group by nextstarttime;

+---------------------+---------+
| nextstarttime       | courses |
+---------------------+---------+
| 2018-10-09 01:30:00 |     374 |
| 2018-10-17 01:30:00 |    1542 |
| 2018-10-29 01:30:00 |     119 |
| 2018-10-31 01:30:00 |       1 |
| 2018-11-04 01:30:00 |       1 |
| 2019-01-17 01:30:00 |       1 |
| 2019-02-09 01:30:00 |       1 |
| 2019-02-27 01:30:00 |    1730 |
+---------------------+---------+

Are the courses with a nextstarttime before 27-02 skipped? What happens when I would update all the rows and nextstarttime with the timestamp of tonight (2019-02-28 01:30:00) ?

 
select laststatus, count(laststatus) as number from mdl_backup_courses group by laststatus;
+------------+--------+
| laststatus | number |
+------------+--------+
| 1          |    285 |
| 2          |      6 |
| 3          |   3478 |
+------------+--------+

Six courses have an errror in the list.

select max(courseid) from mdl_backup_courses;
+---------------+
| max(courseid) |
+---------------+
|          7499 |
+---------------+

select max(id) from mdl_course;
+---------+
| max(id) |
+---------+
|    8017 |
+---------+

As you can see a lot of course id's  are missing in the mdl_backup_courses table (468 courses). New courses aren't
added to the mdl_backup_courses table anymore. Any idea why not?

What happens when I would truncate the table mdl_backup_courses? Will the automated backup not see the
backups that are already created? anymore 



In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

Sorry for late reply ... been busy! :|

| nextstarttime       | courses |
+---------------------+---------+
| 2018-10-09 01:30:00 |     374 |
| 2018-10-17 01:30:00 |    1542 |
| 2018-10-29 01:30:00 |     119 |

Tis he year 2019. so nextstarttime above will never start, me thinks.

What happens when I would update all the rows and nextstarttime with the timestamp of tonight (2019-02-28 01:30:00)

A lot of courses = a lot of processing!!!!  Maybe too much!!!  How about trying to space that out
by a day for X number and by 2 days another set?   Are all those courses still visible and enrolable?

What happens when I would truncate the table mdl_backup_courses?

Last time I messed with this, turncated the data in 3 tables. It was like autobackups had never been run before.
Massive ... and took a very long time.

Think I warned users on Friday @ 5:00 PM and told them what we were doing ... and to expect the site to be slow.  At times, it was slow.  It finally finished one round by Sunday. And I checked status all weekend long.  :\

Got nervous about that so went to bash shell scripts where I could felt like I had greater control ... notice that's 'felt like' ... yes, new courses would not automagcially be added, but entity didn't launch any new courses with students participating very often - @ semester etc.  to be expected.

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Thanks for your tips and answers Ken. I'll think about what would be a good solution to make the automated backup
work good again. I already saw that an update of nextstarttime or truncate of the mdl_backup_courses could cause
serious problems with performance and a huge number of courses that would be backup-ed in a job of the
automated backup.

Do you use the automated backup task that runs every hour in the cron job of Moodle? We use this task too,
and I see that sometimes backups aren't finished when run during heavy workload of the site.

Maybe this subject could be worth overthinking by the developers how to handle these questions to organize your
backup strategy with a large number of courses and possible risks while scheduling a backup without causing
performance problems on your site. A mistake is made easily and you don't want to be called as administrator when
your site is not reachable anymore because of a heavy workload of your automated backup task that has run out of
scheduled time.

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

There's a related on-going 'saga'

https://moodle.org/mod/forum/discuss.php?d=366649#p1478580

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Jerry Lau -

Had the same here with 3.4.6+ and even a 1.2 GB backup took a long time and its just a specific one I wanted to test to see how long it would take via CLI method. Users reported it took so long they quit.. note that I have turned off cron.php just in case so nothing is running that may have an effect with our db server's computing resources.

I came across a setting for automated backup but I can't remember where to turn it off/disabled other than in scheduled task. The other setting was a drop down menu.. can't remember where I saw or how I came across it.. maybe through backup report.




In reply to Jerry Lau

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

@Jeri ... This a question?

Site administration -> Courses -> Backups -> Automated backup setup

Also noticed the queries concerning backup/tables on your server also had a warning?!?

Not trying to send ya down another 'rabbit hole' (like slow queries) but wonder what warning was about?

Execute same query and right afterwards 'show warnings;'

'spirit of sharing', Ken



In reply to Ken Task

Re: New courses not added to table mdl_backup_courses

by Jerry Lau -

How can I show what is in the warning? how can I narrow that down and get more details as to what these warning are?

In reply to Jerry Lau

Re: New courses not added to table mdl_backup_courses

by Ken Task -
Picture of Particularly helpful Moodlers

Run same query.

Right after you run the same query, then execute: show warnings;

Let's see the warnings first before chasin' down another rabbit hole ... unless you like that sort of thing?  No vulcan mind meld possible here!!!!!

'spirit of sharing', Ken


In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Jerry Lau -

I am dead meat … LOL

| nextstarttime       | courses |
+---------------------+---------+
| 2019-02-02 02:00:00 |       4 |
| 2019-02-09 02:00:00 |       5 |
| 2019-02-23 02:00:00 |    2384 |
+---------------------+---------+
3 rows in set, 1 warning (0.00 sec)

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi,

If it can help with problems you encouter with big courses that don't backup well, you can read in this discussion where i expose my configuration and backup related settings, and also this one where i detail a way to skip (big) courses (as explained in MDL-60296).

HTH,
Séverin

In reply to Séverin Terrier

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

Thanks Séverin, I'll take a look at your links! Do you think MDL-60296 will be implemented in a future release?

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

To be honest, i don't think so, in the near future...

Until someone provides dedicated code (better solution), or perhaps there are really a big number of votes.
Or if the MUA propose it as a project (but i think it keeps an admin problem, and that will not collect most votes between the MUA projects).

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

I just found out while testing in a new environment with a copy of our production site that the automated backup just stops when a corrupted backup is found in the backup directory. This means that the automated backup process is out of sync at that moment. All the courses that are not yet read by the automated backup script remain with the nextstarttime of the last (failed) run. These courses will never be backupped anymore. My backup broke after having read a third part of all courses in mdl_backup_courses. I deleted the corrupted backup, made a new (manual) backup of this course to be sure if I was able to backup this course and uploaded the backup to the map with all the (automated) backups. Tonight I'll see if there's another course in my map that'll cause the automated backup to stop.

This was the error I got at the point the automated backup was prematurely ended (and it said it wasn't possible to read the archive):

!!! Fout bij het verwerken van het archiefbestand !!!


To be sure that all courses will be read by the automated backup script I updated the nextstarttime for all rows in mdl_backup_courses with the date of the next scheduled automated backup run (tonight):

mysql statement: update mdl_backup_courses set nextstarttime = unix_timestamp('2019-03-30 00:00:00');

Average of ratings: Useful (1)
In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

I had three broken automated backup runs because of corrupted Moodle course backups, after removing these backups after every run from the backup folder I now have the automated backup running for all courses again. Also new courses are added to the backup table mdl_backup_courses again.

In reply to Alain Raap

Re: New courses not added to table mdl_backup_courses

by Alain Raap -
Picture of Particularly helpful Moodlers

We have implemented the automated backup with a Moodle instance on the database server in production and it's running for several weeks now without any problems, all changed (and new) courses are being backup-ed again. All courses are in sync now and new courses are added to the mdl_backup_courses table again.
In this message I already wrote about this issue and how we solved it https://moodle.org/mod/forum/discuss.php?d=385643

The large course that takes 9,5 hours to backup , is backup-ed in the weekend now, and kept outside the automated backup, run with a bash script which backups one or more large courses from an inputfile.