Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-42717

Ensure automated backup files are deleted when an error occurs because of directory permissions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.8, 2.5.2, 2.6.3
    • Fix Version/s: 2.7.4, 2.8.2
    • Component/s: Backup
    • Testing Instructions:
      Hide
      1. Turn on full debugging
      2. Go to Site administration / ►Courses / ►Backups / ►Automated backup setup
      3. Set the following:-
        1. backup_auto_active - Enabled
        2. backup_auto_storage - Specified directory for automated backups
        3. backup_auto_destination - Path to a folder that doesn't exist
        4. Use course name in backup filename - checked
        5. backup_auto_skip_modif_days - never
        6. backup_auto_skip_modif_prev - unchecked
      4. Run php php admin/cli/automated_backups.php
      5. Make sure you get logs like:-

        Specified backup directory is not writable -  /ankit/moodles/stable_master/backup
        

      6. Go to Site admin>reports>backups
      7. Make sure status of all courses that were backed up is "Error"
      8. Make sure no new backup is generated in "course automated backup area" (click on course >restore)
      9. set 'backup_auto_destination' to null, by making the input box empty.
      10. Run php php admin/cli/automated_backups.php
      11. Make sure you get logs like:-

        No directory specified for automated backups
        

      12. Go to Site admin>reports>backups
      13. Make sure status of all courses that were backed up is "warning"
      14. Now test again with a proper writable directory and make sure backups are generated properly.
      15. Testing rest of the log entries is bit tricky. Just do exploratory testing with autoamted backups to make sure nothing is broken.
      Show
      Turn on full debugging Go to Site administration / ►Courses / ►Backups / ►Automated backup setup Set the following:- backup_auto_active - Enabled backup_auto_storage - Specified directory for automated backups backup_auto_destination - Path to a folder that doesn't exist Use course name in backup filename - checked backup_auto_skip_modif_days - never backup_auto_skip_modif_prev - unchecked Run php php admin/cli/automated_backups.php Make sure you get logs like:- Specified backup directory is not writable - /ankit/moodles/stable_master/backup Go to Site admin>reports>backups Make sure status of all courses that were backed up is "Error" Make sure no new backup is generated in "course automated backup area" (click on course >restore) set 'backup_auto_destination' to null, by making the input box empty. Run php php admin/cli/automated_backups.php Make sure you get logs like:- No directory specified for automated backups Go to Site admin>reports>backups Make sure status of all courses that were backed up is "warning" Now test again with a proper writable directory and make sure backups are generated properly. Testing rest of the log entries is bit tricky. Just do exploratory testing with autoamted backups to make sure nothing is broken.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-42717-master
    • Sprint:
      BACKEND Sprint 18

      Description

      Hello,

      While investigating the significant growth of moodledata. I have found out that the automatic course backup is not deleting older files. The keep setting is setted on '1'.

      I have also setted that the backups must be stored in a alternative folder and not in moodledata itself.

      In the alternative folder I see only one course backup per course, so that is good. I don't know where the course backups are stored in moodledata. What I do know is that when I delete the older backup files in the course, moodledata is decreasing a lot.

      I have attached screenshots to show what I mean.

      I have tested this in a clean Moodle site, without plugins and strange code to prevent conflicts.

        Attachments

        1. alternative folder.PNG
          alternative folder.PNG
          6 kB
        2. another_one.PNG
          another_one.PNG
          48 kB
        3. auto_course_backup.PNG
          auto_course_backup.PNG
          40 kB
        4. auto_settings.PNG
          auto_settings.PNG
          14 kB
        5. plugin_blocks.PNG
          plugin_blocks.PNG
          38 kB

          Issue Links

            Activity

              People

              • Votes:
                13 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Jan/15