Skip to content

Commit

Permalink
MDL-32547 backup: Add setting for backup folder tidy up.
Browse files Browse the repository at this point in the history
  • Loading branch information
abgreeve committed Nov 28, 2014
1 parent 67eb7d7 commit c35d736
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions admin/settings/server.php
Expand Up @@ -153,6 +153,19 @@
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);


Expand Down
2 changes: 2 additions & 0 deletions lang/en/admin.php
Expand Up @@ -342,6 +342,7 @@
$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.';
Expand Down Expand Up @@ -1037,6 +1038,7 @@
$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';
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/task/file_temp_cleanup_task.php
Expand Up @@ -46,7 +46,7 @@ public function execute() {

$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.
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -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.

Expand Down

0 comments on commit c35d736

Please sign in to comment.