case 'credits': showHelp($option); break; case 'restore': HTML_cloner::Restore($option); break; case 'cron_delete': if (unlink($_CONFIG['multiple_config_dir'] . "/" . $_REQUEST['fconfig'])) { $msg = " was deleted"; } else { $msg = " was not deleted, please delete it manually!"; } mosRedirect('index2.php?option=' . $option . "&task=config", $_REQUEST['fconfig'] . $msg); break; case 'remove': deleteBackups($cid, $option); break; case 'continue': case 'move': case 'clone': moveBackup($option); break; case 'cancel': mosRedirect('index2.php?option=' . $option); break; case 'config': config($option); break; case 'rename_cancel': mosRedirect('index2.php?option=' . $option . "&task=view"); break;
<?php // can't just kill the script set_time_limit(0); // includes require_once 'S3.php'; //Setup variables $MYSQL_OPTIONS = '--quote-names --quick --add-drop-table --add-locks --allow-keywords --disable-keys --extended-insert --single-transaction --create-options --comments --net_buffer_length=16384'; $BACKUP_BUCKET = awsBucket; //Setup S3 class $s3 = new S3(awsAccessKey, awsSecretKey); //delete old backups deleteBackups($BACKUP_BUCKET); // Backup functions // Backup files and compress for storage function backupFiles($targets, $prefix = '') { global $BACKUP_BUCKET, $s3; foreach ($targets as $target) { // compress local files $cleanTarget = urlencode($target); `tar cjf "{$prefix}-{$cleanTarget}.tar.bz2" "{$target}"`; // upload to s3 $s3->putObjectFile("{$prefix}-{$cleanTarget}.tar.bz2", $BACKUP_BUCKET, s3Path($prefix, $target . "-backup.tar.bz2")); // remove temp file `rm -rf "{$prefix}-{$cleanTarget}.tar.bz2"`; } } // Backup all Mysql DBs using mysqldump function backupDBs($hostname, $username, $password, $prefix = '') {