View Single Post
  #3  
Old 2nd September 2009, 16:28
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Quote:
Originally Posted by pat View Post
Here are a couple of suggestions to changes to the backup routine. The first one is a pure cosmetical change and makes sure the hostname is part of the resulting filename. The second one is a little more interesting and makes sure we are not limited by available RAM when choosing output to browser rather than via FTP.

Cheers,
Pat


Code:
--- backup.php.orig     2009-05-20 19:33:53.000000000 +0200
+++ backup.php  2009-05-20 19:33:45.000000000 +0200
@@ -58,7 +58,7 @@
 if(strlen($ftp_user) < 1 and $transfer == 'ftp') $go_api->errorMessage($go_api->lng("Sie haben keinen FTP Benutzernamen angegeben."));

 // Erstelle Namen für Backup Datei
-$backup_file_name = "backup_".date("Y_m_d",time()).".zip";
+$backup_file_name = exec("hostname") . "-backup_".date("Y_m_d",time()).".zip";

 // bestimme Web-Pfad
 $server = $go_api->db->queryOneRecord("SELECT * from isp_server");
@@ -154,7 +154,7 @@
                 header("Content-Length: ".filesize($tgz_name));

         // gebe Daten aus
-        echo file_get_contents($tgz_name);
+        readfile($tgz_name);

         // lösche temp Verzeichnis
         if($tmp_dir != "" and stristr($tmp_dir,"/home/admispconfig/ispconfig/temp") and !stristr($tmp_dir,"../")) exec("rm -rf $tmp_dir");
I've just implemented this.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote