Automatic Backup stopped working

Re: Automatic Backup stopped working

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

'timing out' is a possibility ... what is setting in php.ini for max_execution_time, max_input_time, max_input_vars, memory_limit?

Location of cli script:

moodlecodefolder/admin/cli/automated_backups.php

says to run as apache user and in the script provides this as example (for Linux systems that use sudo):

Example:
\$sudo -u www-data /usr/bin/php admin/cli/automated_backups.php

On Windows machines, not sure what would be required to run it via command line - or if one could.  At one time, the cli directory scripts were said to be linux only.

That being said, however, I run as root user (not sudo) and here's what it looks like (live/real server, BTW).  Note that if autobackups are scheduled running cli auto backups will just get notification of when the backups are scheduled to run.  Any course that has not been modified in the last X days (an option moodle admin can set), the course won't be backed up.  More comments following example below:

[root@sos cli]# php automated_backups.php
Server Time: Fri, 22 Mar 2013 13:59:35 -0500


Checking automated backup status...OK
Getting admin info
Checking courses
Skipping deleted courses...0 courses
Running required automated backups...
Backing up Moodle24...
complete - next execution: Sat, 23 Mar 2013 02:55:00 -0500
Backup of 'Course Test of Backup' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Course Test of Backup (Not modified in the past 5 days)
Backing up Tinker...
complete - next execution: Sat, 23 Mar 2013 02:55:00 -0500
Backup of 'Sandbox Course for Restricting Students (scars)' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Sandbox Course for Restricting Students (scars) (Not modified in the past 5 days)
Backup of 'upload' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping upload (Not modified in the past 5 days)
Backup of 'Creating Student e-Portfolios with Google Sites' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Creating Student e-Portfolios with Google Sites (Not modified in the past 5 days)
Backup of 'History10' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping History10 (Not modified in the past 5 days)
Backup of 'Mathematics Standard Y10' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Mathematics Standard Y10 (Not modified in the past 5 days)
Backup of 'Business Services year 11 2012' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Business Services year 11 2012 (Not modified in the past 5 days)
Backup of 'English' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping English (Not modified in the past 5 days)
Backup of 'SA' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping SA (Not modified in the past 5 days)
Backup of 'xfer' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping xfer (Not modified in the past 5 days)
Backup of 'iPads 101' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping iPads 101 (Not modified in the past 5 days)
Backup of 'iPads 101 copy 1' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping iPads 101 copy 1 (Not modified in the past 5 days)
Backup of 'M2 GBU!' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping M2 GBU! (Not modified in the past 5 days)
Backup of 'Kens Moodle FP resources' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Kens Moodle FP resources (Not modified in the past 5 days)
Backup of 'Advanced Moodle Administration (Linux)' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Advanced Moodle Administration (Linux) (Not modified in the past 5 days)
Backup of 'Shelly Test' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping Shelly Test (Not modified in the past 5 days)
Backup of '1.9 Test without course_files' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping 1.9 Test without course_files (Not modified in the past 5 days)
Backup of 'M2 GBU! copy 1' is scheduled on Sat, 23 Mar 2013 02:55:00 -0500
Skipping M2 GBU! copy 1 (Not modified in the past 5 days)
Backing up MR Sandbox...
complete - next execution: Sat, 23 Mar 2013 02:55:00 -0500
Sending email to admin
Automated backups complete.
Automated cron backups completed correctly
Execution took 7.87399 seconds

To get this to run where I could see it run, I had to set the cron job to run at a time slightly in the future ... save 5 minutes from the current time ... and then, from the command line, start executing the script just after the time for cron to run.

Once I saw it work/execute ... checked the alternate directory for presence of backups and if that had worked ok, reset the time for cron to run to something sensible ... wee hours of AM - non prime time for not only Moodle usage but for any other automated/scheduled process server might be scheduled to do - like rotate logs (which, on a Linux box would also cause a re-start of services), doing mysql dumps, etc...

'spirit of sharing', Ken