From 1c6b268465d01655553553d01c03d4944138a4b0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 04 Jan 2012 10:55:45 -0500
Subject: [PATCH] Added: FS#1954 - Add a config file backup option in the ispconfig updater - FS#1898 Added username after client name in IP address list
---
install/update.php | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/install/update.php b/install/update.php
index 4da9fce..223613a 100644
--- a/install/update.php
+++ b/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');
--
Gitblit v1.9.1