Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6619

Re: Automated backup problem

$
0
0
by Ken Task.  

Sorry for length of this, but .....

If there has been any change to a course, it is backed up.
Is there anything in that course that changes?  Is the backup of that course failing due to size?

With automated backups someone should be getting an Email notification.
In that message, it should report the success or failure of the process.
Is there a line in that message that says something to the affect that
one course was not backed up successfully?

Afraid one is going to have to do some investigation of the DB on this.
Got a tool to query the DB?   Since this involves timing, some of the fields
you'll see will be in Unix epoch time ... therefore, you need to locate an
epoch time converter on Internet to assist.

Here is one: http://www.epochconverter.com/

First, note the course ID number.

Then using whatever tool you have to query DB, query the mdl_backup_courses table
for that course ID using:

select * from mdl_backup_courses where coursed=[courseid]

where the [courseid] above is the course id number.  Example: courseid is 41

mysql> select * from mdl_backup_courses where courseid=41;
+----+----------+---------------+-------------+------------+---------------+
| id | courseid | laststarttime | lastendtime | laststatus | nextstarttime |
+----+----------+---------------+-------------+------------+---------------+
| 19 |       41 |    1432820706 |  1432820713 | 1          |    1432976100 |
+----+----------+---------------+-------------+------------+---------------+

Then use the epoch time converter to get the dates of those fields above which are
epoch times.

If you do not include the courseid you'll be able to compare the 'troubled' course to
the other courses.

One also needs to view what might be in /moodledata/temp/backup/
A failed backup will leave a hash named directory - a long name ...
7b9b856a2e8290d3a399a99295f4344c

That's an indication of a backup that failed.

IF you see one of those directories, there is probably a hash named .log file
larger than 0 bytes.   It is ascii text so one could inspect that .log file
for a clue.

Could also inspect the contents of that directory for a moodle_backup.xml file.
That file is also text/ascii.  It is a 'roadmap' for the backup. Inspecting it, one can see the course name and other details.

That would also be a reason that a course is continually backed up.  Never finishes, therefore nothing recorded in mdl_backup_courses to indicate it completed successfully.

It is safe to remove any all files/folders from /moodledata/temp/backup/
And it is recommend when attempting to discover the issues.  Start with a clean slate, so to speak.

So ... here's what I think I'd do ...
1. remove all the rows in mdl_backup_courses - NOT the table, but the data in the table.
2. revisit the setup of automated backups.  Set Active to Active ... we'll try to force the running of it via the running of cron.
TEMP set the Execute at time say 5 minutes into the future of present time.
Present time: 8:46 ... set Exceute at: 8:51.

I'd also set Specified directory for automated backups to something outside of
moodle's filedir.   Something like:
/home/autocoursebackups/
 
You must create directories manually.  Moodle will not create them for you.

Then run the cron job manually ... either command line:
cd /pathtomoodlecode/admin/cli/
php cron.php

OR via browser:

http://moodle/admin/cron.php

Run it multiple times until you see the automated backups kick in.

When it does, you'll see this in the cron job output:

Checking courses
Skipping deleted courses...0 courses
Running required automated backups...
... started 08:55:38. Current memory use 12.2MB.
Backing up Moodle26...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up Tinker...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up Creating Student e-Portfolios with Google Sites...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up SA...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up iPads 101...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up M2 GBU!...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up Advanced Moodle Administration (Linux)...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up Android Apps...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Backing up 2 Moodles Compared...
complete - next execution: Tue, 14 Jul 2015 08:55:00 -0500
Sending email to admin
Automated backups complete.

And in the designated directory one should see all the courses:

[root@sos cli]# ls -l /home/autobackups/*201507*
-rw-rw-rw- 1 root apache 676682441 Jul 13 08:57 /home/autobackups/backup-moodle2-course-1689-android-20150713-0757.mbz
-rw-rw-rw- 1 root apache   1491118 Jul 13 08:57 /home/autobackups/backup-moodle2-course-1690-2mdlcomp-20150713-0757.mbz
-rw-rw-rw- 1 root apache   6078880 Jul 13 08:55 /home/autobackups/backup-moodle2-course-1-mdl26-20150713-0755.mbz
-rw-rw-rw- 1 root apache   1099043 Jul 13 08:56 /home/autobackups/backup-moodle2-course-34-sa-20150713-0756.mbz
-rw-rw-rw- 1 root apache  15467026 Jul 13 08:56 /home/autobackups/backup-moodle2-course-37-ipads-20150713-0756.mbz
-rw-rw-rw- 1 root apache  33750836 Jul 13 08:56 /home/autobackups/backup-moodle2-course-39-m2gbu-20150713-0756.mbz
-rw-rw-rw- 1 root apache  67885978 Jul 13 08:55 /home/autobackups/backup-moodle2-course-3-tinker-20150713-0755.mbz
-rw-rw-rw- 1 root apache  25699450 Jul 13 08:56 /home/autobackups/backup-moodle2-course-41-ama-20150713-0756.mbz
-rw-rw-rw- 1 root apache   9251407 Jul 13 08:56 /home/autobackups/backup-moodle2-course-6-eportfolio-20150713-0756.mbz

and one should get an email notification:

Summary
==================================================
  Courses; 9
  OK; 9
  Skipped; 0
  Error; 0
  Unfinished; 0
  Warning; 0
  Automated backup pending; 0

  Backup completed successfully

If it's all good, reset the options to Automated backups to something
sensible.

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 6619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>