public static function CheckDumpClouds() { $arRes = array(); if (IntOption('dump_do_clouds') && $arAllBucket = CBackup::GetBucketList()) { foreach($arAllBucket as $arBucket) if (IntOption('dump_cloud_'.$arBucket['ID'])) $arRes[] = $arBucket['ID']; if (count($arRes)) return $arRes; } return false; }
foreach($arCloudFiles['file'] as $k=>$v) { $arTmpFiles[] = array( 'NAME' => $v, 'SIZE' => $arCloudFiles['file_size'][$k], 'DATE' => '', 'PERMISSION' => 'X', 'BUCKET_ID' => $arBucket['ID'], 'PLACE' => htmlspecialcharsbx($arBucket['BUCKET'].' ('.$arBucket['SERVICE_ID'].')') ); } } } } $arWriteBucket = CBackup::GetBucketList($arFilter = array('READ_ONLY' => 'Y')); $arParts = array(); $arSize = array(); foreach($arTmpFiles as $k=>$ar) { if (preg_match('#^(.*\.(enc|tar|gz))(\.[0-9]+)?$#',$ar['NAME'],$regs)) { $arParts[intval($ar['BUCKET_ID']).$regs[1]]++; $arSize[$regs[1]] += $ar['SIZE']; if (!$regs[3]) $arFiles[] = $ar; } } $rsDirContent = new CDBResult;
{ $size = filesize($name); $NS['arc_size'] += $size; if ($arParams["disk_space"] > 0) CDiskQuota::updateDiskQuota("file", $size, "add"); $name = CTar::getNextName($name); } $tar->close(); } $NS['step'] = 3; } if ($NS['step'] == 3) { // Download cloud files if ($arParams['dump_do_clouds'] && ($arDumpClouds = CBackup::GetBucketList())) { ShowBackupStatus('Downloading cloud files'); foreach($arDumpClouds as $arBucket) { $id = $arBucket['ID']; if ($NS['bucket_finished_'.$id]) continue; $obCloud = new CloudDownload($arBucket['ID']); $obCloud->last_bucket_path = $NS['last_bucket_path']; if ($res = $obCloud->Scan('')) { $NS['bucket_finished_'.$id] = true; } else
$tar->addFile($after_file); unlink($NS["dump_name"]) && (!file_exists($after_file) || unlink($after_file)); $NS['arc_size'] = 0; $name = $NS["arc_name"]; while (file_exists($name)) { $size = filesize($name); $NS['arc_size'] += $size; if ($arParams["disk_space"] > 0) { CDiskQuota::updateDiskQuota("file", $size, "add"); } $name = CTar::getNextName($name); } $tar->close(); } // Download cloud files if ($arDumpClouds = CBackup::GetBucketList()) { ShowBackupStatus('Downloading cloud files'); foreach ($arDumpClouds as $arBucket) { $obCloud = new CloudDownload($arBucket['ID']); $res = $obCloud->Scan(''); } } $DB->Disconnect(); // Tar files if (true) { ShowBackupStatus('Archiving files'); $DOCUMENT_ROOT_SITE = DOCUMENT_ROOT; if (!defined('DOCUMENT_ROOT_SITE')) { define('DOCUMENT_ROOT_SITE', $DOCUMENT_ROOT_SITE); } $tar = new CTar();