Location: PHPKode > projects > Key-med > sauvegardes/readme.html
<html>

<head>
<title>phpMySQLAutoBackup - Readme</title>
<link rel="stylesheet" type="text/css" href="pmab.css">
</head>

<body>
<div align="center"><center>

<table cellSpacing="3" cellPadding="0" border="0" width="631">
  <tr>
    <td width="396"><p align="center"><a href="http://www.dwalker.co.uk/phpmysqlautobackup/"><img src="http://www.dwalker.co.uk/phpmysqlautobackup/pmab.gif" alt="phpMySQLAutoBackup automates the backup of MySQL databases." align="absbottom" border="0" height="18" width="147"></a><small><br>
            the simple way to<br>
                  <strong>backup MySQL databases</strong><br>
   <br>
    </small></td>
    <td width="269"><div align="center"><strong>README</strong><em><br>
            <br><small>Sponsors: <a href="http://www.seiretto.com/web_hosting/php_hosting.php">PHP hosting</a> and<br> 
        <a href="http://www.s4servers.com/">UK dedicated servers</a></em></small></div></td>
  </tr>
</table>
</center></div>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="encrypted"
  value="-----BEGIN PKCS7-----MIIHiAYJKoZIhvcNAQcEoIIHeTCCB3UCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAF9lb6ZGHH1AmbpB9RxDCsLc7HUxRbIXLFumVh3UpDYY1EJS/QiyTGsgaAEGRdq/mEduz8K37Tc6tzphGNbQ0mm+m28b0fGkqu25oJLgGcDy+kn3/iQpaE+SaUNG5EzcfVuhiRIuaqJnzIdIKewR33pik0a9eMiZNaLMry66CRDzELMAkGBSsOAwIaBQAwggEEBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECKFP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vGbxe9WT9S1wob7BDWZJRroYGUpIGRMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAIFfOlaagFrl71+jq6OKidbWFSE+Q4FqROvdgIONth+8kSK//Y/4ihuE4Ymvzn5ceE3S/iBSQQMjyvb+s2TWbQYDwcp129OPIbD9epdr4tJOUNiSojw7BHwYRiPh58S1xGlFgHFXwrEBb3dgNbMUa+u4qectsMAXpVHnD9wIyfmHMYIBmjCCAZYCAQEwgZQwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjEyMTgxMDI3MjRaMCMGCSqGSIb3DQEJBDEWBBTfz07u/YJBNl4YlVa7drcN1cdAmjANBgkqhkiG9w0BAQEFAASBgBaK6kzW6+7eFUJgMtw71QPcvliHtaQicRM6RWYCup/13HQlF3l9zrf6dqNXRsb06TF1u+UwkMBEztMtT4UFyRJ2QugACrQW5AHO2SK43siSgxEk5Y+6mkux3iX31CpYZWAuvL0phEqsE+/pCbiaESPdcHY4SbW79lEjnErLIAxz-----END PKCS7-----
"><div
  align="center"><center>
    <p><small>Released under <a href="LICENSE">GPL License</a></small></p>
      <p>Please consider making a <a name="donation">donation</a>, even a
        single Dollar (or a Pound) would be great!<br>
        <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0"
  name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> 
        <img alt
  border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"> <br>
        This ain't a big organisation - its just me. </p>
  </center></div>
</form>


<div align="center">
<div class="cssbox" style="width:290">  <div class="cssbox_head">
    <p><strong><big>My other applications:</big><br>
  </strong><br>
  Create your own members area:<br>
      <a href="http://www.dwalker.co.uk/phpautomembersarea/"><img src="http://www.dwalker.co.uk/phpautomembersarea/pamalogo.gif" alt="phpAMA - create a members area using PHP MySQL, protect your members only or adult content" border="0"></a> <br>
<a href="http://www.dwalker.co.uk/phpautomembersarea/" >phpAutoMembersArea</a>      <br>
      <br>
      Run cron jobs with ease hourly, daily, or weekly, and log the output:
    <table border="0" align="center" bgcolor="#ffffff">
      <tr>
        <td><a href="http://www.phpjobscheduler.co.uk/"><img src="http://www.phpjobscheduler.co.uk/pjslogo.gif" alt="phpJobScheduler - scheduling PHP scripts to run at set intervals your replacement for cron jobs.&nbsp; " border="0" height="75" width="165"></a></td>
        </tr>
    </table>
    <a href="http://www.phpjobscheduler.co.uk">phpJobScheduler</a>
    </p>
</div>  
  <div class="cssbox_body"></div>  
</div></div>
<hr width="85%" color="#808080" align="center">
<p align="center"><a href="http://www.dwalker.co.uk/phpmysqlautobackup/"><img src="http://www.dwalker.co.uk/phpmysqlautobackup/pmab.gif" alt="phpMySQLAutoBackup automates the backup of MySQL databases." align="absbottom" border="0" height="18" width="147"></a><small><br>
the simple way to<br>
<strong>backup MySQL databases</strong></small><br>
Automates the backup of MySQL databases.  <br>
The PHP scripts export your database (data and structures),<br>
compresses it into gzip format and emails it to you.  </p>
<p align="center"><strong><font color="#FF9933">Note will now only run once per hour by default, to alter this see $time_internal below.</font></strong></p>
<p align="left"><big><strong>To upgrade an existing installation:</strong><big> </big></big></p>

<ol>
  <li>BACKUP your original files.&nbsp;</li>
  <li>Follow the install details below (note: you can use your original run.php file, but need
    to add the new variables detailed below to benefit from the new features).</li>
</ol>

<hr width="85%" color="#808080" align="center">

<p align="left"><big><strong>To install:</strong> </big></p>

<ol>
  <li>Unzip the files and upload to your server.<blockquote>
      <p>You should upload the files and folders retaining the <strong>original names</strong>&nbsp;</p>
    </blockquote>
  </li>
  <li>To configure your installation, add your details to the following variables within file
    /phpMySQLAutoBackup/<strong>run.php:</strong><blockquote>
      <blockquote>
        <ol type="a">
          <li><strong>$db_server</strong><br>
          &quot;localhost&quot; is normally fine - if not then please contract your web host </li>
          <li><strong>$db</strong><br>
            set to your MySQL database name<br>
          </li>
          <li><strong>$mysql_username</strong><br>
            set to your MySQL username</li>
          <li><strong>$mysql_password</strong><br>
            set to your MySQL password</li>
          <li><strong>$to_emailaddress<br>
          </strong>set to your email address to send backup files to (leave blank to not send emails) </li>
          <li><strong>$from_emailaddress<br>
          </strong>set to a different email address than above - else some spam detectors will bin the email </li>
          <li><strong>$save_backup_zip_file_to_server<br>
            </strong>If you set the variable <strong>$save_backup_zip_file_to_server</strong> to 1
            then the backup files will be saved in the folder: /phpmysqlautobackup/backups/ <br>
            &nbsp;&nbsp;&nbsp; <font color="#FF0000">(ensure you chmod [777] the backups folder for write access to allow for file
            creation)</font></li>
          <li><strong>$time_internal</strong> - interval between backups - stops malicious attempts at bringing down your server by making multiple requests to run the backup. By default this is set to one hour (3600 seconds), will only allow the backup to run once each hour. You could reduce to 180 (five minutes) when testing so you do not have to wait an hour! Do remember to put this backup to at least 3600 when testing is completed. </li>
          <li><strong>$table_select </strong>- leave commented out if you need to backup the whole
            database<strong>.<br>
            </strong>If you uncomment the variable <strong>$table_select</strong> then only the
            specified named tables will be selected for backup.&nbsp; The table names must be correct
            else the backup will not select any tables.
            <blockquote>
              <p><strong>The correct format is:</strong><br>
              $table_select[0]=&quot;MyFirstTableName&quot;;<br>
              $table_select[1]=&quot;MySecondTableName&quot;;<br>
              $table_select[2]=&quot;MyThirdTableName&quot;;<br>
              $table_select[x]=&quot;MylastTableName&quot;;<br>
              <br>
              You can add any number of table names.<br>
              <br>
              <font color="#FF0000">If you specify distinct tables names, as above, then ONLY those
              tables will be included in your backup.<br>
              </font><br>
              For a list of table names to backup for popular applications including phpBB and phpAMA
              see:<br>
              <a href="http://www.dwalker.co.uk/forum/viewtopic.php?t=491">http://www.dwalker.co.uk/forum/viewtopic.php?t=491</a>              </p>
            </blockquote>
          </li>
          <li><strong>$limit_from<br>
            </strong>record number to start from, use this if you have a large table to backup.&nbsp;
            Should be used with a single table setting like:<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            $table_select[0]=&quot;MyFirstTableName&quot;;</li>
          <li><strong>$limit_to</strong><br>
            total rows to export <br>
            <br>
            The two variables above are used in the SQL query:<br>
            &nbsp;&nbsp; <em>SELECT * FROM tablename LIMIT <strong>$limit_from , $limit_to</strong><br>
            </em>These variables have been added to allow for the backup of just a section of a very
            large table with millions of records.<br>
          </li>
          <li><strong>Debugging</strong> - uncomment the line:&nbsp; error_reporting(E_ALL);<br>
            This will then display any errors.&nbsp; Do remember to comment out this line out once you
            have the application working.</li>
        </ol>
        <p><strong>TIP:</strong>&nbsp; If you need to backup several different databases or tables at different
        backup times you can copy the run.php file, and rename it appropriately.</p>
      </blockquote>
    </blockquote>
  </li>
  <li>To run the backup:<br>
      <blockquote>
        <blockquote>
          <p>Enter in your address bar the url:</p>
          <p><a href="http://www.[Your---domain].com/phpMySQLAutoBackup/run.php">http://www.[Your--domain].com/phpmysqlautobackup/run.php</a><br>
            &nbsp; (runs silently [no output], unless there are errors, OHhh no.)</p>
        </blockquote>
      </blockquote>
        <blockquote>
          <p align="left"><strong>If you have entered the above details correctly this will export
            your database, compress it into gzip format and email it to you.</strong><br>
            <br>
          When run correctly for the first time it will create a new table within your database called: phpmysqlautobackup, which contains a single record to monitor the last time it was run (used to stop abuse). </p>
          <p align="left">To schedule it to run hourly/daily/monthly add the above url to a cron job
            or use the <big><font face="Garamond">excellent <a href="http://www.phpjobscheduler.co.uk/">phpJobScheduler</a></font></big></p>
    </blockquote>
  </li>
</ol>

<p><strong>Common errors or issues: </strong></p>
<blockquote>
  <p>If you experience problems then the most common error is the script timing-out; usually error messages are:</p>
  <blockquote>
    <p><font color="red">Fatal error:  Maximum execution time of 50 seconds exceeded in</font>, or<br>
    <font color="red">Fatal error: allowed memory size of bytes exhausted (tried to allocate bytes)</font>, or  <br>
      <font color="red">Internal Server Error, this is an error with your script</font>, or other similar message </p>
  </blockquote>
  <p>Then you need to either:</p>
  <ul>
    <li>Specify specific table names to backup, see 2.i. above, or</li>
    <li>  Set the upper and lower export limits see 2.j. and 2.k. above.<br>
      <br>
      <ul>
        <li> If you make these settings:
          <ul>
            <li> $limit_to=1000; //total rows to export </li>
            <li> $limit_from=0; //record number to start from <br>
              <br>
              This will backup all records from the first row and upto 1000 rows. <br>
              <br>
                    </li>
          </ul>
        </li>
        <li>If you make these settings:
                <ul>
                  <li> $limit_to=1000; //total rows to export </li>
                  <li> $limit_from=1001; //record number to start from      <br>  
                    <br>
This will backup all records from row 1001 and upto 1000 rows.       <br>
<br>
<br>
If you copy the run.php file, and rename it appropriately then you can run the several backups of the data starting at different rows.<br>
<br>
Confused? Got a question? Try searching the forum:<br> 
<a href="http://www.dwalker.co.uk/forum/search.php">http://www.dwalker.co.uk/forum/search.php</a> <br>  
                    <br>
                  </li>
                </ul>
        </li>
      </ul>
    </li>
  </ul>
</blockquote>
<p>I do hope you find it useful, and if you use it let me know&nbsp; ;-)</p>
<p>And if you are feeling generous then you might even consider <a href="#donation">giving
a tiny donation</a>, any small amount helps keep the wheels turning.</p>
</body>
</html>
Return current item: Key-med