From e96fad36fd611e877fe1467ad2e40f51637a4c73 Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 30 Apr 2009 16:21:51 -0600 Subject: FreeSWITCH change backup path from /tmp to /root/backup --- config/freeswitch/freeswitch_status.tmp | 37 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'config/freeswitch') diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp index dbe1c9cb..7c13f44f 100644 --- a/config/freeswitch/freeswitch_status.tmp +++ b/config/freeswitch/freeswitch_status.tmp @@ -45,9 +45,12 @@ if ($_GET['a'] == "download") { $filename = 'Master.csv'; } if ($_GET['t'] == "backup") { - $tmp = '/tmp/'; + $tmp = '/root/backup/'; $filename = 'freeswitch.bak.tgz'; - system('cd /usr/local/;tar cvzf /tmp/freeswitch.bak.tgz freeswitch'); + if (!is_dir('/root/backup/')) { + exec("mkdir /root/backup/"); + } + system('cd /usr/local/;tar cvzf /root/backup/freeswitch.bak.tgz freeswitch'); } session_cache_limiter('public'); $fd = fopen($tmp.$filename, "rb"); @@ -60,25 +63,25 @@ if ($_GET['a'] == "download") { if ($_GET['a'] == "other") { if ($_GET['t'] == "restore") { - $tmp = '/tmp/'; + $tmp = '/root/backup/'; $filename = 'freeswitch.bak.tgz'; //extract a specific directory to /usr/local/freeswitch - if (file_exists('/tmp/'.$filename)) { + if (file_exists('/root/backup/'.$filename)) { //echo "The file $filename exists"; //Recommended - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/db/'); - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/log/'); - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/recordings/'); - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/scripts/'); - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/storage/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/'); //Optional - //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/'); - //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/'); - //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/htdocs/'); - //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/'); + //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/'); + //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/'); + //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/'); + //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/'); header( 'Location: freeswitch_status.php?savemsg=Backup+has+been+restored.' ) ; } @@ -102,7 +105,7 @@ $savemsg = $_GET["savemsg"]; if (!pkg_is_service_running('freeswitch')) { $handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r"); pclose($handle); - //give freeswitch time to load before processing the rest of the page. + //give freeswitch time to load sleep(7); } ?> @@ -265,14 +268,14 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; -- cgit v1.2.3
\n"; echo "Backup / Restore
\n"; -echo "The 'backup' button will tar gzip /usr/local/freeswitch/ to /tmp/freeswitch.bak.tgz it then presents a file to download. \n"; -echo "If the backup file does not exist in /tmp/freeswitch.bak.tgz then the 'restore' button will be hidden. \n"; +echo "The 'backup' button will tar gzip /usr/local/freeswitch/ to /root/backup/freeswitch.bak.tgz it then presents a file to download. \n"; +echo "If the backup file does not exist in /root/backup/freeswitch.bak.tgz then the 'restore' button will be hidden. \n"; echo "Use Diagnostics->Command->File to upload: to browse to the file and then click on upload it now ready to be restored. \n"; echo "

\n"; echo "
\n"; echo " \n"; -if (file_exists('/tmp/freeswitch.bak.tgz')) { +if (file_exists('/root/backup/freeswitch.bak.tgz')) { echo " \n"; } echo "