Exemplo n.º 1
0
    $tmp_folder = setupTmpFolder($folders);
}
if (0 == errorCount()) {
    $cache = setupGitCacheFolder($folders);
}
define('GIT_CACHE_DEST', $cache[0]);
if (0 == errorCount()) {
    for ($x = 0; $x < count($folders); $x++) {
        buildFilesList($cache, $files_list, GIT, $exclude_files, $folders[$x]);
    }
}
if (0 == errorCount() && $cache[1] == GITNEW) {
    downloadFiles($files_list);
}
if (0 == errorCount()) {
    backupFiles($tmp_folder, $files_list);
}
if (0 == errorCount()) {
    copyFiles($files_list);
}
if (0 == errorCount()) {
    $dbupdate = updateDB($nuConfigDBHost, $nuConfigDBName, $nuConfigDBUser, $nuConfigDBPassword);
}
if (errorCount() > 0) {
    $finalResult['message'] = 'ERRORS';
} else {
    $finalResult['message'] = 'SUCCESS';
}
$successCount = count($success);
$finalResult['errors'] = $errors;
$finalResult['success'] = array("{$successCount} File(s) updated");
Exemplo n.º 2
0
<?php

// AWS access info
define('awsAccessKey', '');
define('awsSecretKey', '');
define('awsBucket', '');
require_once 'include/backup.inc.php';
//backupDBs - hostname, username, password, prefix
//backupFiles - array of paths, prefix
backupDBs('localhost', 'username', 'password', 'my-database-backup');
backupFiles(array('/home/myuser', '/etc'), 'me');
backupFiles(array('/var/www'), 'web files');
Exemplo n.º 3
0
<?php

include "../config.php";
include "../include/common.php";
include "../include/db_connect.php";
include "../include/session.php";
include "../include/backup.php";
if (isset($_SESSION['root'])) {
    $backupLink = FALSE;
    if (isset($_REQUEST['backup'])) {
        $dbResult = backupDatabase();
        $fileResult = backupFiles();
        if ($fileResult !== false) {
            $backupLink = array($dbResult, $fileResult[0], $fileResult[1]);
            $success = "Backup created!";
        } else {
            $error = "Something went wrong! If this continues, contact us!";
        }
    }
    if (isset($success)) {
        get_page_advanced("backup", "root", array('backupLink' => $backupLink, 'success' => $success));
    } else {
        if (isset($error)) {
            get_page_advanced("backup", "root", array('backupLink' => $backupLink, 'error' => $error));
        } else {
            if (isset($warning)) {
                get_page_advanced("backup", "root", array('backupLink' => $backupLink, 'warning' => $warning));
            } else {
                if (isset($info)) {
                    get_page_advanced("backup", "root", array('backupLink' => $backupLink, 'info' => $info));
                } else {