MDL-32547 backup: Add setting for backup folder tidy up.

This commit is contained in:
Adrian Greeve 2014-11-24 09:45:27 +08:00
parent 67eb7d7804
commit c35d736a44
4 changed files with 17 additions and 2 deletions

View File

@ -153,6 +153,19 @@ $temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_strin
60 => new lang_string('numdays', '', 60),
30 => new lang_string('numdays', '', 30))));
$temp->add(new admin_setting_configselect('tempdatafoldercleanup', new lang_string('tempdatafoldercleanup', 'admin'),
new lang_string('configtempdatafoldercleanup', 'admin'), 168, array(
1 => new lang_string('numhours', '', 1),
3 => new lang_string('numhours', '', 3),
6 => new lang_string('numhours', '', 6),
9 => new lang_string('numhours', '', 9),
12 => new lang_string('numhours', '', 12),
18 => new lang_string('numhours', '', 18),
24 => new lang_string('numhours', '', 24),
48 => new lang_string('numdays', '', 2),
168 => new lang_string('numdays', '', 7),
)));
$ADMIN->add('server', $temp);

View File

@ -342,6 +342,7 @@ $string['configstripalltitletags'] = 'Uncheck this setting to allow HTML tags in
$string['configsupportemail'] = 'This email address will be published to users of this site as the one to email when they need general help (for example, when new users create their own accounts). If this email is left blank then no such helpful email address is supplied.';
$string['configsupportname'] = 'This is the name of a person or other entity offering general help via the support email or web address.';
$string['configsupportpage'] = 'This web address will be published to users of this site as the one to go to when they need general help (for example, when new users create their own accounts). If this address is left blank then no link will be supplied.';
$string['configtempdatafoldercleanup'] = 'Remove temporary data files from the data folder that are older than the selected time.';
$string['configthemedesignermode'] = 'Normally all theme images and style sheets are cached in browsers and on the server for a very long time, for performance. If you are designing themes or developing code then you probably want to turn this mode on so that you are not served cached versions. Warning: this will make your site slower for all users! Alternatively, you can also reset the theme caches manually from the Theme selection page.';
$string['configthemelist'] = 'Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you can specify a comma-separated list of names here (Don\'t use spaces!).
For example: standard,orangewhite.';
@ -1037,6 +1038,7 @@ $string['tasksessioncleanup'] = 'Cleanup old sessions';
$string['taskstatscron'] = 'Background processing for statistics';
$string['tasktagcron'] = 'Background processing for tags';
$string['tasktempfilecleanup'] = 'Delete stale temp files';
$string['tempdatafoldercleanup'] = 'Clean up temporary data files older than';
$string['themedesignermode'] = 'Theme designer mode';
$string['themelist'] = 'Theme list';
$string['themenoselected'] = 'No theme selected';

View File

@ -46,7 +46,7 @@ class file_temp_cleanup_task extends scheduled_task {
$tmpdir = $CFG->tempdir;
// Default to last weeks time.
$time = strtotime('-1 week');
$time = time() - ($CFG->tempdatafoldercleanup * 3600);
$dir = new \RecursiveDirectoryIterator($tmpdir);
// Show all child nodes prior to their parent.

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2014112000.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2014112000.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.