mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
backup restoration 90% completed
This commit is contained in:
parent
1155e9065e
commit
65db51189c
16 changed files with 330 additions and 99 deletions
25
web/schedule/backup/index.php
Normal file
25
web/schedule/backup/index.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$v_username = escapeshellarg($user);
|
||||
exec (VESTA_CMD."v-schedule-user-backup ".$v_username, $output, $return_var);
|
||||
if ($return_var == 0) {
|
||||
$_SESSION['backup_msg'] = _('BACKUP_SCHEDULED');
|
||||
} else {
|
||||
$_SESSION['backup_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['backup_msg'])) {
|
||||
$_SESSION['backup_msg'] = _('Error: vesta did not return any output.');
|
||||
}
|
||||
|
||||
if ($return_var == 4) {
|
||||
$_SESSION['backup_msg'] = _('BACKUP_EXISTS');
|
||||
}
|
||||
|
||||
}
|
||||
unset($output);
|
||||
header("Location: /list/backup/");
|
||||
exit;
|
40
web/schedule/restore/index.php
Normal file
40
web/schedule/restore/index.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$backup = escapeshellarg($_GET['backup']);
|
||||
|
||||
$web = 'no';
|
||||
$dns = 'no';
|
||||
$mail = 'no';
|
||||
$db = 'no';
|
||||
$cron = 'no';
|
||||
$udir = 'no';
|
||||
|
||||
if ($_GET['type'] == 'web') $web = escapeshellarg($_GET['object']);
|
||||
if ($_GET['type'] == 'dns') $dns = escapeshellarg($_GET['object']);
|
||||
if ($_GET['type'] == 'mail') $mail = escapeshellarg($_GET['object']);
|
||||
if ($_GET['type'] == 'db') $db = escapeshellarg($_GET['object']);
|
||||
if ($_GET['type'] == 'cron') $cron = 'yes';
|
||||
if ($_GET['type'] == 'udir') $udir = escapeshellarg($_GET['object']);
|
||||
|
||||
if (!empty($_GET['type'])) {
|
||||
exec (VESTA_CMD."v-schedule-user-restore ".$user." ".$backup." ".$web." ".$dns." ".$mail." ".$db." ".$cron." ".$udir, $output, $return_var);
|
||||
if ($return_var == 0) {
|
||||
$_SESSION['restore_msg'] = _('RESTORE_SCHEDULED');
|
||||
} else {
|
||||
$_SESSION['restore_msg'] = implode('<br>', $output);
|
||||
if (empty($_SESSION['restore_msg'])) {
|
||||
$_SESSION['restore_msg'] = _('Error: vesta did not return any output.');
|
||||
}
|
||||
if ($return_var == 4) {
|
||||
$_SESSION['restore_msg'] = _('RESTORE_EXISTS');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: /list/backup/?backup=" . $_GET['backup']);
|
Loading…
Add table
Add a link
Reference in a new issue