예제 #1
0
파일: dump.php 프로젝트: nProfessor/Mytb
					if ($BUCKET_ID = intval($_REQUEST['BUCKET_ID']))
					{
						// Not realized 'cos no cloud API
					}
					else
					{
						while(file_exists(DOCUMENT_ROOT.$path.'/'.$ID))
						{
							if (!rename(DOCUMENT_ROOT.$path.'/'.$ID, DOCUMENT_ROOT.$path.'/'.$new_name))
							{
								$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_FILE_RENAME").htmlspecialcharsbx($ID), $ID);
								break;
							}

							$ID = CTar::getNextName($ID);
							$new_name = CTar::getNextName($new_name);
						}
					}
				}
				else
					$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_NAME"), $ID);
			break;
		}
	}
}
InitSorting();

$arDirs = array();
$arFiles = array();
$arTmpFiles = array();
$arFilter = array();
예제 #2
0
파일: backup.php 프로젝트: ASDAFF/entask.ru
				default:
				break;
			}

			$cnt--;
			$f = $p.'/'.$name;
	//		echo "delete ".$f."\n";

			$bDel = false;
			while(file_exists($f))
			{
				$size = filesize($f);
				$TotalSize -= $size;
				if (($bDel = unlink($f)) && $arParams["disk_space"] > 0)
					CDiskQuota::updateDiskQuota("file", $size , "del");
				$f = CTar::getNextName($f);
			}
			if (!$bDel)
				RaiseErrorAndDie('Could not delete file: '.$f, 700, $NS['arc_name']);
		}
	}
	$NS['step'] = 8;
}


$info = "Finished.\n\nData size: ".round($NS['data_size']/1024/1024, 2)." M\nArchive size: ".round($NS['arc_size']/1024/1024, 2)." M\nTime: ".(time() - START_TIME)." sec\n";
ShowBackupStatus($info);
CEventLog::Add(array(
	"SEVERITY" => "WARNING",
	"AUDIT_TYPE_ID" => "BACKUP_SUCCESS",
	"MODULE_ID" => "main",
예제 #3
0
파일: restore.php 프로젝트: ASDAFF/open_bx
		$bottom = '<input type="button" value="'.getMsg('BUT_TEXT_BACK').'" onClick="document.location=\'/restore.php?Step=1&lang='.LANG.'\'"> ';

		if ($rs = $tar->openRead($file1 = $file = $_SERVER['DOCUMENT_ROOT'].'/'.$arc_name))
		{
			$DataSize = intval($_REQUEST['DataSize']);
			$skip = '';

			if(!$DataSize) // first step
			{
				$Block = $tar->Block;
				if (!$ArchiveSize = $tar->getDataSize($file))
					$ArchiveSize = filesize($file) * 2; // for standard gzip files
				$DataSize = $ArchiveSize;

				while(file_exists($file1 = CTar::getNextName($file1)))
					$DataSize += $ArchiveSize;

				$r = true;
				SetCurrentProgress(0);

				if ($n = CTar::getLastNum($file))
				{
					for($i=1;$i<=$n;$i++)
					{
						if (!file_exists($file.'.'.$i))
						{
							$strErrMsg = getMsg('ERR_NO_PARTS').' <b>'.($n + 1).'</b>';
							$r = false;
							break;
						}
예제 #4
0
파일: restore.php 프로젝트: nProfessor/Mytb
				'BOTTOM' => '<input type="button" value="'.getMsg('BUT_TEXT_BACK').'" onClick="document.location=\'/restore.php?Step=1&lang='.LANG.'\'"> '
			);
			html($ar);
			die();
		}
		elseif ($res==2) // частичная закачка
		{
			$text = getMsg('ARC_DOWN_PROCESS').' <b>'.htmlspecialchars($arc_name).'</b>' . $status .
			'<input type=hidden name=Step value=2>'.
			'<input type=hidden name=source value=download>'.
			'<input type=hidden name=continue value=Y>'.
			'<input type=hidden name=arc_down_url value="'.htmlspecialchars($url).'">';
		}
		else
		{
			$next_arc_name = CTar::getNextName($arc_name);
			$next_url = str_replace($arc_name, $next_arc_name, $url);
			$res = LoadFile($next_url, $next_arc_name, $strNextRealUrl);
			if ($res != false && $strRealUrl != $strNextRealUrl)
			{
				$text = getMsg('ARC_DOWN_PROCESS').' <b>'.htmlspecialchars($next_arc_name).'</b>' . $status .
				'<input type=hidden name=Step value=2>'.
				'<input type=hidden name=source value=download>'.
				'<input type=hidden name=continue value=Y>'.
				'<input type=hidden name=arc_down_url value="'.htmlspecialchars($next_url).'">';
			}
			else
			{
				$text = $status .
				'<input type=hidden name=Step value=2>'.
				'<input type=hidden name=arc_name value="'.htmlspecialchars(preg_replace('#\.[0-9]+$#','',$arc_name)).'">';