Automated Backup File Management

Automated Backup File Management

by Thorsten Siegmund Bartel -
Number of replies: 0

Hey everyone,

automated backups currently have one flaw: If they're saved only within the specified directory for automated backups, they won't be listed under "Automated backups" when restoring a course (backup/restorefile.php). This is unfortunate, since it doesn't enable teachers / managers to restore a course from automated backups. Instead, an administrator needs to manually perform such a restoration via CLI or Upload of the .mbz file.

I would like suggest a local plugin that manages these backup files and allows the following:

  • Displaying a list of all (automated) backups, their size, etc. for site administrators
    Bonus Goals:
    • Display all kinds of backups (manual backups, activity backups, backups in user file areas, etc.)
    • Tie visibility of list to capability so it can be assigned to support roles
    • Make list searchable / add filters
    • Add bulk processing options to backups
      (This could be used to mass restore courses from the backup area - which could be lovely for migrating a moodle instance.)
  • Display automated backups of a course on the course restoration page
    Bonus Goals:
    • Split capabilities for automated backup files for viewing, restoring and downloading
    • Add logic to display (estimated) date of deletion for backup files (i.e. if backup_auto_delete_days or backup_auto_max_kept are set).

As these backups are not stored in the moodledata filedir, Moodle would have to track them somehow. My idea would be a table that is populated by an event observer listening for events of completed / deleted automated backups as well as a (hourly / daily / weekly) scheduled task to crawl the automated backup directory.

Or whatever you got. I'm open for any ideas regarding solutions as long as you're interested in working on this. smile

Cheers
Thorsten