Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Need to archive backup_controllers log, too. #1

Open
ctam opened this issue Jun 6, 2014 · 4 comments
Open

Need to archive backup_controllers log, too. #1

ctam opened this issue Jun 6, 2014 · 4 comments
Assignees

Comments

@ctam
Copy link
Contributor

ctam commented Jun 6, 2014

Looks like this is new in Moodle 2.6 and up:

lib/cronlib.php:

        // Delete old backup_controllers and logs.
        $loglifetime = get_config('backup', 'loglifetime');
        if (!empty($loglifetime)) {  // Value in days.
            $loglifetime = $timenow - ($loglifetime * 3600 * 24);
            // Delete child records from backup_logs.
            $DB->execute("DELETE FROM {backup_logs}
                           WHERE EXISTS (
                               SELECT 'x'
                                 FROM {backup_controllers} bc
                                WHERE bc.backupid = {backup_logs}.backupid
                                  AND bc.timecreated < ?)", array($loglifetime));
            // Delete records from backup_controllers.
            $DB->execute("DELETE FROM {backup_controllers}
                          WHERE timecreated < ?", array($loglifetime));
            mtrace(" Deleted old backup records");
        }

@stopfstedt stopfstedt self-assigned this May 6, 2017
@stopfstedt stopfstedt added this to the Moodle 3.2 milestone May 6, 2017
@stopfstedt
Copy link
Member

@ctam - is this still relevant?

@stopfstedt stopfstedt removed this from the Moodle 3.2 milestone May 8, 2017
@ctam
Copy link
Contributor Author

ctam commented May 9, 2017

I think so. They have moved the code to here.

@ctam
Copy link
Contributor Author

ctam commented May 9, 2017

Taking a second look, we are not using the 'Automated backups' feature on our site, so this is not important to us. But if we were to implement this, it will make this plugin more complete. There were also discussions that we would want to enable 'Automated backups' on our site. So, we may want to revisit this then. I think we can table this for now.

@stopfstedt
Copy link
Member

@ctam Thanks for the feedback.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants