First some background information:
The problems started in 1.3.x and continued in 1.4.3 for awhile. I upgraded to 1.5.1 and then 1.5.2 and the problem continued.
In an attempt to resolve this issue, I deleted the old installation of Moodle and removed all related databases. I performed a clean installation of 1.5.2 and then restored the courses.
My Moodle has 5 courses. Manual backups work great. Automatic/scheduled backups fail ~85% of the time.
CRONTAB
Every ~8 minutes, I run:
lynx -connect_timeout=300 -dump http://www.constructiveteacher.com/admin/cron.php > /dev/null via the CRON daemon.
(I just recently added the -connect_timeout=300 string to see if that would resolve the problem - it did not)
When an automatic backup fails, I receive this email from the CRON Daemon at my webhost (Total Choice).
----------------------------------------------------------
Looking up www.constructiveteacher.com
www.constructiveteacher.com
Making HTTP connection to www.constructiveteacher.com
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can't Access `http://www.constructiveteacher.com/admin/cron.php'
Alert!: Unable to access document.
lynx: Can't access startfile
----------------------------------------------------------lynx: Can't access startfile
Once I receive this email, the cron.php script reports that a "Backup is in Progress" for the next ~45 minutes or so. At some point the program realizes the backup has stalled and then it sends me a backup report.
----------------------------------------------------------
Summary
=====================
Courses: 4
OK: 3
Error: 0
Unfinished: 1
----------------------------------------------------------OK: 3
Error: 0
Unfinished: 1
I've tried some different user suggestions that I've read.
- Optimize the database via phpMyAdmin (credit: Peter Cameron)
- I changed the backup directory to /moodledata/globalbackups/ instead of the individual course directories. (credit: James Depow)
- I manually set the path to zip / gzip in the Moodle config. (credit: Tim Allen)
Here is some info about the actual backups I have:
----------------------------------------------------------
Click on a folder icon to navigate.
Click on a name to view its properties.
/ mdata / globalbackups / (Current Folder)
backup-biology_1-20050729-0826.zip 42986 k 2777
backup-cteacher-20050729-0826.zip 92 k 2777
backup-gs-20050729-0828.zip 1708 k 2777
backup-life_science_1-20050729-0826.zip 7152 k 2777
backup-ls_-_1-20050729-0828.zip 16 k 2777
----------------------------------------------------------backup-life_science_1-20050729-0826.zip 7152 k 2777
backup-ls_-_1-20050729-0828.zip 16 k 2777
The problem usually occurs on the biology backup - it's the 43MB backup. Perhaps that has something to do with it? It occasionally fails on life_science as well - the 7MB backup.
Work Around
If I change the moodle config to not include the course files, the backups are significantly smaller - all are less than 500k. When I do this, the backups very rarely fail - only ~5% of the time or less.
Then I just have to remember to do a manual backup every now and then to make sure that the course content has been backed up.
Also, I haven't thoroughly tested this, but if I use my web browser to call /admin/cron.php instead of letting the CRON Daemon call it, a full backup fails much less frequently. I'd say a full backup is successful ~25%+ of the time!
Has anyone determined the cause of this? There seems to be some random element involved. The CRON daemon itself seems to be somewhat involved as does the size of the backup.
Caleb Benefiel