From 7e7fb10565a04e82c507d83ddaa0061c725cb294 Mon Sep 17 00:00:00 2001 From: mcrane Date: Sat, 13 Jun 2009 15:01:06 -0600 Subject: Backup and TFTP package change backup directory to /root/backup/ --- config/backup/backup.inc | 5 +++++ config/backup/backup.tmp | 22 +++++++++++----------- config/backup/backup.xml | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) (limited to 'config/backup') diff --git a/config/backup/backup.inc b/config/backup/backup.inc index fa2783d6..b6adfbc9 100644 --- a/config/backup/backup.inc +++ b/config/backup/backup.inc @@ -95,6 +95,11 @@ function php_install_command() if (!is_dir('/usr/local/www/packages/backup/')) { exec("mkdir /usr/local/www/packages/backup/"); } + + //create the backup directory + if (!is_dir('/root/backup/')) { + exec("mkdir /root/backup/"); + } //rename PHP files from .tmp to .php exec("cp /tmp/backup.tmp /usr/local/www/packages/backup/backup.php"); diff --git a/config/backup/backup.tmp b/config/backup/backup.tmp index 546f9c3e..10e03db3 100644 --- a/config/backup/backup.tmp +++ b/config/backup/backup.tmp @@ -46,9 +46,9 @@ if ($_GET['act'] == "del") { if ($_GET['a'] == "download") { if ($_GET['t'] == "backup") { - $tmp = '/tmp/'; + $tmp = '/root/backup/'; $filename = 'pfsense.bak.tgz'; - //system('cd /usr/local/;tar cvzf /tmp/pfsense.bak.tgz freeswitch'); + //system('cd /usr/local/;tar cvzf /root/backup/pfsense.bak.tgz freeswitch'); $i = 0; if (count($a_backup) > 0) { @@ -79,13 +79,13 @@ if ($_GET['a'] == "download") { if ($_GET['a'] == "other") { if ($_GET['t'] == "restore") { - $tmp = '/tmp/'; + $tmp = '/root/backup/'; $filename = 'pfsense.bak.tgz'; //extract the tgz file - if (file_exists('/tmp/'.$filename)) { + if (file_exists('/root/backup/'.$filename)) { //echo "The file $filename exists"; - system('cd /; tar xvpfz /tmp/'.$filename.' '); + system('cd /; tar xvpfz /root/backup/'.$filename.' '); header( 'Location: backup.php?savemsg=Backup+has+been+restored.' ) ; } else { @@ -98,9 +98,9 @@ if ($_GET['a'] == "other") { if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { $filename = 'pfsense.bak.tgz'; - move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tmp/" . $filename); - $savemsg = "Uploaded file to /tmp/" . htmlentities($_FILES['ulfile']['name']); - system('cd /; tar xvpfz /tmp/'.$filename.' '); + move_uploaded_file($_FILES['ulfile']['tmp_name'], "/root/backup/" . $filename); + $savemsg = "Uploaded file to /root/backup/" . htmlentities($_FILES['ulfile']['name']); + system('cd /; tar xvpfz /root/backup/'.$filename.' '); } @@ -183,13 +183,13 @@ if ($_GET["savemsg"]) { echo "\n"; echo "\n"; echo "Backup / Restore
\n"; - echo "The 'backup' button will tar gzip the directories that are listed below to /tmp/pfsense.bak.tgz it then presents a file to download. \n"; - echo "If the backup file does not exist in /tmp/pfsense.bak.tgz then the 'restore' button will be hidden. \n"; + echo "The 'backup' button will tar gzip the directories that are listed below to /root/backup/pfsense.bak.tgz it then presents a file to download. \n"; + echo "If the backup file does not exist in /root/backup/pfsense.bak.tgz then the 'restore' button will be hidden. \n"; echo "

\n"; echo "\n"; echo "\n"; echo " \n"; - if (file_exists('/tmp/pfsense.bak.tgz')) { + if (file_exists('/root/backup/pfsense.bak.tgz')) { echo " \n"; } echo "\n"; diff --git a/config/backup/backup.xml b/config/backup/backup.xml index a0f72ba2..b48a8e28 100644 --- a/config/backup/backup.xml +++ b/config/backup/backup.xml @@ -41,7 +41,7 @@ Describe your package requirements here Currently there are no FAQ items provided. Backup Settings - 0.1.5 + 0.1.6 Settings /usr/local/pkg/backup.inc -- cgit v1.2.3