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

file_temp_cleanup_task only does a partial delete.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course.
      2. Create a failed backup. I edited the backup_stepslib.php file and put a die(); in one of the functions.
      3. Check moodledata/temp/backup and ensure that there are directories listed there.
      4. Update the scheduled task "Clean up failed backup files from the temp directory" [Site administration ► Server ► Scheduled tasks] and change all of the times to '*'.
      5. I don't recommend waiting a week to see if the files get deleted, so I would change the following (lib/classes/task/file_temp_cleanup_task.php):

        $time = strtotime('-1 week');
        

        to

        $time = strtotime('-1 minute');
        

      6. Run the cron.
      7. Have a look in the temp/backup directory and check that all of the directories have been removed.
      Show
      Create a course. Create a failed backup. I edited the backup_stepslib.php file and put a die(); in one of the functions. Check moodledata/temp/backup and ensure that there are directories listed there. Update the scheduled task "Clean up failed backup files from the temp directory" [Site administration ► Server ► Scheduled tasks] and change all of the times to '*'. I don't recommend waiting a week to see if the files get deleted, so I would change the following (lib/classes/task/file_temp_cleanup_task.php): $time = strtotime('-1 week'); to $time = strtotime('-1 minute'); Run the cron. Have a look in the temp/backup directory and check that all of the directories have been removed.
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-48252-master
    • Sprint:
      BACKEND Sprint 18

      Description

      file_temp_cleanup_task will only delete the most extreme children in a directory structure.
      The code looks to see what time the file was modified, if it is older than a week it is deleted. Unfortunately the directory that the file was in has the time modified field changed and the directory is not removed until a week later when it eventually fits the criteria again.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

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