Пример #1
0
	'skip_symlinks' => IntOption('skip_symlinks', 0),
);

if (!is_array($arExpertBackupParams))
	$arExpertBackupParams = array();
	
$arParams = array_merge($arExpertBackupDefaultParams, $arExpertBackupParams, $arParams);
$skip_mask_array = $arParams['skip_mask_array'];

if (strtolower($DB->type) != 'mysql')
	$arParams['dump_base'] = 0;

if (!$NS['step'])
{
	$NS = array('step' => 1);
	$NS['dump_encrypt_key'] = CPasswordStorage::Get('dump_temporary_cache');
	$dump_bucket_id = IntOption('dump_bucket_id');
	if ($dump_bucket_id == -1)
	{
		if (!$bBitrixCloud || !$NS['dump_encrypt_key'])
		{
			$dump_bucket_id = 0;
			ShowBackupStatus('BitrixCloud is not available');
		}
	}
	$NS['BUCKET_ID'] = $dump_bucket_id;

	if ($dump_bucket_id == -1)
		$arc_name = DOCUMENT_ROOT.BX_ROOT."/backup/".date('Ymd_His_').rand(11111111,99999999);
	elseif(($arc_name = $argv[1]) && !is_dir($arc_name))
		$arc_name =  str_replace(array('.tar','.gz','.enc'),'',$arc_name);
Пример #2
0

<tr class="heading">
	<td colspan="2"><?php 
echo GetMessage("DUMP_MAIN_ARC_MODE");
?>
</td>
</tr>

<tr>
	<td><?php 
echo GetMessage("MAIN_DUMP_ENABLE_ENC");
?>
<span class="required"><sup>2</sup></td>
	<td><input type="checkbox" name="dump_encrypt" value="Y" <?php 
echo $BUCKET_ID == -1 || CPasswordStorage::Get('dump_temporary_cache') ? "checked" : "";
?>
 <?php 
echo !$bMcrypt || $BUCKET_ID == -1 ? 'disabled' : '';
?>
></td>
</tr>
<tr>
	<td width=40%><?php 
echo GetMessage('INTEGRITY_CHECK_OPTION');
?>
</td>
	<td><input type="checkbox" name="dump_integrity_check" value="Y" <?php 
echo IntOption('dump_integrity_check') ? 'checked' : '';
?>
>
             continue;
         }
         $ID = intval($ID);
         switch ($_REQUEST['action']) {
             case "delete":
                 $strError = CBitrixCloudBackup::getInstance()->deleteBackupJob();
                 break;
         }
     }
 }
 if ($_SERVER["REQUEST_METHOD"] === "POST" && check_bitrix_sessid()) {
     require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/backup.php";
     $backup_secret_key = CPasswordStorage::Get('backup_secret_key');
     if (strlen($backup_secret_key) <= 0) {
         $backup_secret_key = randString(10);
         CPasswordStorage::Set('backup_secret_key', $backup_secret_key);
     }
     $time = 0;
     if (preg_match("/^(\\d{1,2}):(\\d{1,2})\$/", $_POST["TIME"], $match)) {
         $time = $match[1] * 3600 + $match[2] * 60;
     }
     $strError = CBitrixCloudBackup::getInstance()->addBackupJob($backup_secret_key, $_POST["URL"], $time, $_POST["WEEK_DAYS"]);
     if ($strError == "") {
         LocalRedirect("/bitrix/admin/bitrixcloud_backup_job.php?lang=" . LANGUAGE_ID);
     }
 }
 $arHeaders = array(array("id" => "URL", "content" => GetMessage("BCL_BACKUP_JOB_URL"), "default" => true), array("id" => "TIME", "content" => GetMessage("BCL_BACKUP_JOB_TIME"), "align" => "right", "default" => true), array("id" => "WEEK_DAYS", "content" => GetMessage("BCL_BACKUP_JOB_WEEK_DAYS"), "default" => true), array("id" => "STATUS", "content" => GetMessage("BCL_BACKUP_JOB_STATUS"), "default" => true), array("id" => "FINISH_TIME", "content" => GetMessage("BCL_BACKUP_JOB_FINISH_TIME"), "align" => "right", "default" => true));
 $arJobs = CBitrixCloudBackup::getInstance()->getBackupJob();
 if (is_string($arJobs)) {
     throw new CBitrixCloudException($arJobs);
 }