tbrehm
2012-01-04 1c6b268465d01655553553d01c03d4944138a4b0
install/update.php
@@ -123,6 +123,27 @@
echo "This application will update ISPConfig 3 on your server.\n";
//* Make a backup before we start the update
$do_backup = $inst->simple_query('Shall the script create a ISPConfig backup in /var/backup/ now?', array('yes','no'),'yes');
if($do_backup == 'yes') {
   //* Create the backup directory
   $backup_path = '/var/backup/backup/ispconfig_'.date('Y-m-d_H-i');
   $conf['backup_path'] = $backup_path;
   exec("mkdir -p $backup_path");
   exec("chown root:root $backup_path");
   exec("chmod 700 $backup_path");
   //* Do the backup
   swriteln('Creating backup of /usr/local/ispconfig directory...');
   exec("tar pcfz $backup_path/ispconfig_software.tar.gz /usr/local/ispconfig");
   swriteln('Creating backup of /etc directory...');
   exec("tar pcfz $backup_path/etc.tar.gz /etc");
   exec("chown root:root $backup_path/*.tar.gz");
   exec("chmod 700 $backup_path/*.tar.gz");
}
//** Initialize the MySQL server connection
include_once('lib/mysql.lib.php');