mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
* Setup: skip files backup on update even if configured
It might takes the server down for hours and updates usually dont affect the files
This commit is contained in:
parent
c4bcae0598
commit
3248e82d65
@ -858,9 +858,10 @@ class Backup
|
||||
* @param resource $f file opened with fopen for writing
|
||||
* @param boolean $lock_table =null true: allways, false: never, null: if no primary key
|
||||
* default of null limits memory usage if there is no primary key, by locking table and use ROW_CHUCK
|
||||
* @param bool $skip_files_backup =false true: do not backup files, even if config / $this->backup_files is set (used by upgrade)
|
||||
* @todo use https://github.com/maennchen/ZipStream-PHP to not assemble all files in memmory
|
||||
*/
|
||||
function backup($f, $lock_table=null)
|
||||
function backup($f, $lock_table=null, bool $skip_files_backup=false)
|
||||
{
|
||||
//echo "function backup($f)<br>"; // !
|
||||
@set_time_limit(0);
|
||||
@ -876,7 +877,7 @@ class Backup
|
||||
$name = $this->backup_dir.'/db_backup-'.date('YmdHi');
|
||||
$filename = $name.'.zip';
|
||||
$zippresent = false;
|
||||
if(class_exists('ZipArchive') && $this->backup_files)
|
||||
if(class_exists('ZipArchive') && $this->backup_files && !$skip_files_backup)
|
||||
{
|
||||
$zip = new ZipArchive;
|
||||
if(is_object($zip))
|
||||
@ -952,7 +953,7 @@ class Backup
|
||||
|
||||
if(!$zippresent) // save without files
|
||||
{
|
||||
if ($this->backup_files)
|
||||
if ($this->backup_files && !$skip_files_backup)
|
||||
{
|
||||
echo '<center>'.lang("Cant open %1, needs ZipArchive", $name)."<br>\n".'</center>';
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ function do_backup($arg,$quite_check=false)
|
||||
if (is_resource($f = $db_backup->fopen_backup($backup)))
|
||||
{
|
||||
echo lang('Backup started, this might take a few minutes ...')."\n";
|
||||
$db_backup->backup($f);
|
||||
$db_backup->backup($f, null, true); // true: skip (configured) files backup
|
||||
echo lang('Backup finished')."\n";
|
||||
}
|
||||
else // backup failed ==> dont start the upgrade
|
||||
|
Loading…
Reference in New Issue
Block a user