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

Delete tmp files and directories older than one week in cron

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.3
    • Fix Version/s: 2.6
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38570-master

      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

              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13