Tuesday, March 27, 2012

Cron and automated course backups moodle 2.2

The other day, I changed the setting in the
Site Admin|Courses|Backups|Automated backup setup
and specified a directory off the server root, not the web root, to store the backups.

This is a good technical description of the cron script/service and how moodle uses it.

I scheduled the course to backup at midnight. The next day, I did not see any backup files in the directory. It looked like the backups did not run.

Yesterday, I discovered the cron script was responsible for the executing of the automated backup script. I have my cron script executing ever 60 minutes via a Windows service.

Today, the backups were there. I only have 5 courses on my site now, each has its own backup specified like this:

backup-moodle2-course-1-20120327-102.mbz
backup-moodle2-course-3-20120327-102.mbz
...
I expected to find the course name in the backup name, I will look to see if that is something I can change. The backup also emailed the admin account (that's me) indicating the outcome of the backup request.

I will be very interested to see how it handles keeping only two copies of each course. I specified two copies and expect it will remove the other backups, once there are two copies. There was some initial buginess with this feature when moodle 2.0 was released, but that should be corrected in moodle 2.2.

I can also look in my moodle access log and see that my cron task has been running each hr.

127.0.0.1 - - [26/Mar/2012:16:33:01 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2292
127.0.0.1 - - [26/Mar/2012:17:33:01 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1977
127.0.0.1 - - [26/Mar/2012:18:33:01 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2184
127.0.0.1 - - [26/Mar/2012:19:33:01 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1977
127.0.0.1 - - [26/Mar/2012:20:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2106
127.0.0.1 - - [26/Mar/2012:21:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1976
127.0.0.1 - - [26/Mar/2012:22:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1978
127.0.0.1 - - [26/Mar/2012:23:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1979
127.0.0.1 - - [27/Mar/2012:00:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1979
127.0.0.1 - - [27/Mar/2012:01:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2057
127.0.0.1 - - [27/Mar/2012:02:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2089
127.0.0.1 - - [27/Mar/2012:03:33:00 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1979
127.0.0.1 - - [27/Mar/2012:04:32:59 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1974
127.0.0.1 - - [27/Mar/2012:05:32:59 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 1978
127.0.0.1 - - [27/Mar/2012:06:32:59 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2384
127.0.0.1 - - [27/Mar/2012:07:32:59 -0400] "GET /moodle/admin/cron.php HTTP/1.1" 200 2058


The last thing I will do with this today, is practice restoring one of the backups, just to be sure that it will work as expected.

No comments:

Post a Comment