87 $this->_lastOperationSucceed =
false;
90 ignore_user_abort(
true);
93 $rollbackWorker->run();
95 $this->_lastOperationSucceed =
true;
108 ignore_user_abort(
true);
110 $this->_lastOperationSucceed =
false;
116 $filesInfo = $fsHelper->getInfo(
123 if (!$filesInfo[
'readable']) {
125 new Phrase(
'Not enough permissions to read files for backup')
132 $tarPacker =
new Tar();
137 new Phrase(
'Failed to create backup')
143 $gzPacker =
new Gz();
144 $gzPacker->pack($tarTmpPath, $backupPath);
148 new Phrase(
'Failed to create backup')
154 $this->_lastOperationSucceed =
true;
169 $requiredSpace = 2 * $size;
170 if ($requiredSpace > $freeSpace) {
173 'Warning: necessary space for backup is ' . (ceil($requiredSpace) / 1024)
174 .
'MB, but your free disc space is ' . (ceil($freeSpace) / 1024) .
'MB.' 191 $this->_useFtp =
true;
192 $this->_ftpHost = $host;
193 $this->_ftpUser = $username;
194 $this->_ftpPass = $password;
195 $this->_ftpPath =
$path;
220 if (!in_array(
$paths, $this->_ignorePaths)) {
221 $this->_ignorePaths[] =
$paths;
252 parent::setBackupsDir($backupsDir);
274 return 'ftp://' . $this->_ftpUser .
':' . $this->_ftpPass .
'@' . $this->_ftpHost .
$this->_ftpPath;
287 if (!
is_dir($backupsDir)) {
288 $backupsDirParentDirectory = basename($backupsDir);
290 if (!is_writeable($backupsDirParentDirectory)) {
292 new Phrase(
'Cant create backups directory')
302 new Phrase(
'Backups directory is not writeable')
314 $tmpName =
'~tmp-' . microtime(
true) .
'.tar';
324 if (!$this->rollBackFtp) {
327 [
'snapshotObject' => $this]
340 if (!$this->rollBackFs) {
343 [
'snapshotObject' => $this]
elseif(isset( $params[ 'redirect_parent']))
setBackupsDir($backupsDir)
setUseFtp($host, $username, $password, $path)
mkdir($pathname, $mode=0777, $recursive=false, $context=null)
validateAvailableDiscSpace($backupDir, $size)