Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th June 2009, 11:49
pat pat is offline
Junior Member
 
Join Date: Jan 2009
Posts: 9
Thanks: 2
Thanked 3 Times in 2 Posts
Default Large domain backups to browser

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");
Reply With Quote
The Following 2 Users Say Thank You to pat For This Useful Post:
falko (12th June 2009), till (12th June 2009)
Sponsored Links
  #2  
Old 10th August 2009, 12:56
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 3 Times in 2 Posts
Default

Which backup.php is this?There seem to be three files of that name.
Reply With Quote
  #3  
Old 2nd September 2009, 16:28
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 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
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
Mail server using Postfix, Dovecot, Mysql... Postfix virtual maps doesn't work?? tarasbuljba HOWTO-Related Questions 33 28th May 2010 14:33
postfix, pop3 uvbnserved Server Operation 22 24th May 2009 21:00
Help configure Postfix to use alt port 465 or 587 BoloMarkIII Installation/Configuration 10 16th March 2009 17:57
CentoS doesn't send the emails vaio1 Installation/Configuration 18 5th November 2008 17:51


All times are GMT +2. The time now is 06:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.