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

Delete tmp files and directories older than one week in cron

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.3
    • 2.6
    • Administration
    • MOODLE_23_STABLE
    • MOODLE_26_STABLE
    • MDL-38570-master
    • Hide

      This issue needs to be tested on windows and linux and osx.

      These testing instructions verify that temporary files and empty directories older that are one week old (or older) are deleted.

      1. Under the moodledata/temp directory creating files and directories for testing. You can use the “touch” command to create files and directories with a specific time:

      touch -d "25 hours ago" testdir1
      touch -d "1 month ago" testdir2
      touch -d "3 days ago" testfile1
      touch -d "2 weeks ago" testfile2

      2. Run the moodle cron

      Note: that the cleanup is not triggered during every cron run but only approximately 20% of the time. You may need to run the cron more than once.

      3. Verify that files and directories that were given a time of more than one week are deleted from moodledata/temp

      4. Run phpunit tests on linux, windows and macosx

      Show
      This issue needs to be tested on windows and linux and osx. These testing instructions verify that temporary files and empty directories older that are one week old (or older) are deleted. 1. Under the moodledata/temp directory creating files and directories for testing. You can use the “touch” command to create files and directories with a specific time: touch -d "25 hours ago" testdir1 touch -d "1 month ago" testdir2 touch -d "3 days ago" testfile1 touch -d "2 weeks ago" testfile2 2. Run the moodle cron Note: that the cleanup is not triggered during every cron run but only approximately 20% of the time. You may need to run the cron more than once. 3. Verify that files and directories that were given a time of more than one week are deleted from moodledata/temp 4. Run phpunit tests on linux, windows and macosx

    Description

      After 1 year of running Moodle, there are a large number of files stored in the /temp folder of Moodle data directory, which occupied huge disk space Eg. there are files in the subfolders "backup", "csvimport","gradeexport","gradeimport",etc. Are all these files only used temporarily, and safe to be deleted?

      Attachments

        Issue Links

          Activity

            People

              tgus Tim Gus
              ryancwy Ryan Chan
              Tyler Bannister Tyler Bannister
              Dan Poltawski Dan Poltawski
              Petr Skoda Petr Skoda
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13