mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-48266-master' of git://github.com/FMCorz/moodle
Conflicts: version.php
This commit is contained in:
commit
16dafa5d9f
6 changed files with 64 additions and 13 deletions
|
@ -397,16 +397,11 @@ abstract class backup_cron_automated_helper {
|
|||
$outcome = self::outcome_from_results($results);
|
||||
$file = $results['backup_destination']; // May be empty if file already moved to target location.
|
||||
|
||||
if (empty($dir) && $storage !== 0) {
|
||||
// This is intentionally left as a warning instead of an error because of the current behaviour of backup settings.
|
||||
// See MDL-48266 for details.
|
||||
$bc->log('No directory specified for automated backups',
|
||||
backup::LOG_WARNING);
|
||||
$outcome = self::BACKUP_STATUS_WARNING;
|
||||
} else if ($storage !== 0 && (!file_exists($dir) || !is_dir($dir) || !is_writable($dir))) {
|
||||
// If we need to copy the backup file to an external dir and it is not writable, change status to error.
|
||||
$bc->log('Specified backup directory is not writable - ',
|
||||
backup::LOG_ERROR, $dir);
|
||||
// If we need to copy the backup file to an external dir and it is not writable, change status to error.
|
||||
// This is a feature to prevent moodledata to be filled up and break a site when the admin misconfigured
|
||||
// the automated backups storage type and destination directory.
|
||||
if ($storage !== 0 && (empty($dir) || !file_exists($dir) || !is_dir($dir) || !is_writable($dir))) {
|
||||
$bc->log('Specified backup directory is not writable - ', backup::LOG_ERROR, $dir);
|
||||
$dir = null;
|
||||
$outcome = self::BACKUP_STATUS_ERROR;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue