} if (!defined('DOCUMENT_ROOT_SITE')) define('DOCUMENT_ROOT_SITE', $DOCUMENT_ROOT_SITE); $tar = new CTar; $tar->EncryptKey = $NS['dump_encrypt_key']; $tar->ArchiveSizeLimit = IntOption('dump_archive_size_limit'); $tar->gzip = IntOption('dump_use_compression'); $tar->path = DOCUMENT_ROOT_SITE; $tar->ReadBlockCurrent = intval($NS['ReadBlockCurrent']); if (!$tar->openWrite($NS["arc_name"])) RaiseErrorAndDie(GetMessage('DUMP_NO_PERMS')); $Block = $tar->Block; $DirScan = new CDirRealScan; if (!$NS['startPath']) { if (!IntOption('dump_base') && file_exists($f = DOCUMENT_ROOT.BX_ROOT.'/.config.php')) $tar->addFile($f); } else $DirScan->startPath = $NS['startPath']; $r = $DirScan->Scan(DOCUMENT_ROOT_SITE);//.$DIR); $NS["data_size"] += 512 * ($tar->Block - $Block); $tar->close(); if ($r === false) RaiseErrorAndDie(implode('<br>',$DirScan->err));
} if (!defined('DOCUMENT_ROOT_SITE')) define('DOCUMENT_ROOT_SITE', $DOCUMENT_ROOT_SITE); $tar = new CTar; $tar->EncryptKey = $NS['dump_encrypt_key']; $tar->ArchiveSizeLimit = IntOption('dump_archive_size_limit'); $tar->gzip = IntOption('dump_use_compression'); $tar->path = DOCUMENT_ROOT_SITE; $tar->ReadBlockCurrent = intval($NS['ReadBlockCurrent']); if (!$tar->openWrite($NS["arc_name"])) RaiseErrorAndDie(GetMessage('DUMP_NO_PERMS')); $Block = $tar->Block; $DirScan = new CDirRealScan; if (!$NS['startPath']) { if (!IntOption('dump_base') && file_exists($f = DOCUMENT_ROOT.BX_ROOT.'/.config.php')) $tar->addFile($f); } else $DirScan->startPath = $NS['startPath']; $r = $DirScan->Scan(DOCUMENT_ROOT_SITE);//.$DIR); $NS["data_size"] += 512 * ($tar->Block - $Block); $tar->close(); if ($r === false) RaiseErrorAndDie(implode('<br>',array_merge($tar->err,$DirScan->err)));
if ($res) { $NS['step']++; $NS['finished_steps']++; } } } else { $NS["step"]++; } } // Step 4: Tar Files if ($NS["step"] == 4) { $step_done = 0; if (CBackup::CheckDumpFiles() || CBackup::CheckDumpClouds()) { if (haveTime()) { $tar = new CTar(); $DirScan = new CDirRealScan(); $DOCUMENT_ROOT_SITE = DOCUMENT_ROOT; if (is_array($NS['dump_site_id'])) { $SITE_ID = reset($NS['dump_site_id']); $rs = CSite::GetList($by = 'sort', $order = 'asc', array('ID' => $SITE_ID)); if ($f = $rs->Fetch()) { $DOCUMENT_ROOT_SITE = rtrim(str_replace('\\', '/', $f['ABS_DOC_ROOT']), '/'); if ($NS['multisite']) { $tar->prefix = 'bitrix/backup/sites/' . $f['LID'] . '/'; $DirScan->arSkip[$DOCUMENT_ROOT_SITE . '/bitrix'] = true; $DirScan->arSkip[$DOCUMENT_ROOT_SITE . '/upload'] = true; } } } CBackup::$DOCUMENT_ROOT_SITE = $DOCUMENT_ROOT_SITE; CBackup::$REAL_DOCUMENT_ROOT_SITE = realpath($DOCUMENT_ROOT_SITE);
'<input type="password" size=30 name="EncryptKey" autocomplete="off">'. '<input type="hidden" name="arc_name" value="'.$arc_name.'">'. '<input type="hidden" name="Step" value="2">'; $bottom .= ' <input type="button" id="start_button" value="'.getMsg("BUT_TEXT1", LANG).'" onClick="reloadPage(2, \''. LANG.'\')">'; showMsg(getMsg('TITLE_PROCESS1'),$text,$bottom); } else showMsg(getMsg("ERR_EXTRACT", LANG), getMsg('TAR_ERR_FILE_OPEN', LANG).' '.implode('<br>',$tar->err),$bottom); } if ($bClearUnusedStep) { if (file_exists(RESTORE_FILE_LIST)) { include(RESTORE_FILE_LIST); $ds = new CDirRealScan; $ds->startPath = $_REQUEST['nextPath']; $res = $ds->Scan($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules'); if ($res === 'BREAK') { $status = getMsg("SEARCHING_UNUSED", LANG); $hidden = '<input type="hidden" name="nextPath" value="'.$ds->nextPath.'">'. '<input type="hidden" name="clear" value="1">'; $bottom = '<input type="button" value="'.getMsg('BUT_TEXT_BACK').'" onClick="reloadPage(1, \''. LANG.'\')"> '; showMsg(getMsg('TITLE_PROCESS1'),$status.$hidden,$bottom); ?><script>reloadPage(2, '<?php echo LANG; ?> ', 1);</script><? die();