From 6911a4803dcf5a8eea3c0f3d1b000a80be4b97cd Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 30 Apr 2009 16:32:59 -0600 Subject: FreeSWITCH change backup directory for install to the new directory /root/backup --- config/freeswitch/freeswitch.inc | 29 ++++++++++++++++------------- config/freeswitch/freeswitch_status.tmp | 30 ++++++++++++++++-------------- 2 files changed, 32 insertions(+), 27 deletions(-) (limited to 'config/freeswitch') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index f3d432f0..fd7a2041 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -2271,25 +2271,28 @@ function freeswitch_php_install_command() // if backup file exists restore it $filename = 'freeswitch.bak.tgz'; - + if (!is_dir('/root/backup/')) { + exec("mkdir /root/backup/"); + } + //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 /tmp/'.$filename.' freeswitch/sounds/custom/8000/'); - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/music/8000/'); - system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/ssl'); + 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/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/music/8000/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl'); //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 /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/'); unset($filename); } diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp index 7c13f44f..0fa3f6f8 100644 --- a/config/freeswitch/freeswitch_status.tmp +++ b/config/freeswitch/freeswitch_status.tmp @@ -70,20 +70,22 @@ if ($_GET['a'] == "other") { if (file_exists('/root/backup/'.$filename)) { //echo "The file $filename exists"; - //Recommended - 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 /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.' ) ; + //Recommended + 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/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/music/8000/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl'); + + //Optional + //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/'); + + header( 'Location: freeswitch_status.php?savemsg=Backup+has+been+restored.' ) ; } else { header( 'Location: freeswitch_status.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ; -- cgit v1.2.3