Title: multiple backups?
Last modified: August 22, 2016

---

# multiple backups?

 *  [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-backups-1/)
 * Hi, i noticed here
    /wp-content/uploads/ithemes-security/backups several backups,
   why this plugins make so much backups? I need one.. I already checked the settings,
   the only fields looks related is ‘Backups to Retain’, who is set to 0.
 * [https://wordpress.org/plugins/better-wp-security/](https://wordpress.org/plugins/better-wp-security/)

Viewing 14 replies - 31 through 44 (of 44 total)

[←](https://wordpress.org/support/topic/multiple-backups-1/page/2/?output_format=md)
[1](https://wordpress.org/support/topic/multiple-backups-1/?output_format=md) [2](https://wordpress.org/support/topic/multiple-backups-1/page/2/?output_format=md)
3

 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518108)
 * I am seeing the same issue on one of my installations, I’ll see if I can provide
   more information about what is going wrong.
 * My .sql files are about 40MB in size, they are generated every 3-5 minutes. Zip
   is enabled, but the output .zip files are empty.
 * Dwinden’s zip script completes successfully:
 * Zip file created successfully.
    array(1) { [0]=> array(10) { [“filename”]=> string(
   101) “/var/www/html/wp-content/uploads/ithemes-security/backups/backup-tc-1423578796-
   Pc65FEH.sql” [“stored_filename”]=> string(101) “/var/www/html/wp-content/uploads/
   ithemes-security/backups/backup-tc-1423578796-Pc65FEH.sql” [“size”]=> int(40170978)[“
   compressed_size”]=> int(4862009) [“mtime”]=> int(1423553597) [“comment”]=> string(
   0) “” [“folder”]=> bool(false) [“index”]=> int(-1) [“status”]=> string(2) “ok”[“
   crc”]=> int(1752657305) } }
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518109)
 * memory_limit is set to 160M
    memory_get_peak_usage() reports 82MB on dwinden’s
   test
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518110)
 * I think this could still be a memory issue …
 * Do you also have the same problem as the topic starter when making a backup by
   clicking on the “Create Database Backup” button on the Backups page ?
 * I’m referring to this update from the topic creator:
 * The strange part is if i click on this
    [https://www.diigo.com/item/image/51ynl/dhi2](https://www.diigo.com/item/image/51ynl/dhi2)
   i get a blank page :/
 * dwinden
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518111)
 * I can’t easily trigger a backup from the webinterface, backups are always running.
 * “Something went wrong with your backup. It looks like another process might already
   be trying to backup your database. Please try again in a few minutes. If the 
   problem persists please contact support.”
 * I am still trying to find a good way to debug the code.
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518112)
 * Oh I forgot to mention this in my previous post.
    Before the iTSec code starts
   a database backup it sets memory_limit to 128 MB if current memory_limit < 128
   MB:
 * ITSEC_Lib::set_minimum_memory_limit( ‘128M’ );
 * Please update this topic with the following values on your iTSec Dashboard page(
   System Information – PHP Information):
 * PHP Memory Usage
    PHP Memory Limit PHP Max Script Execution Time
 * dwinden
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518113)
 * Just noticed your last update …
    In order to be able to properly test the “Create
   Database Backup” button from the Backups page make the following **(temporary)**
   changes to the Backup settings in the order as specified:
 * untick the “Compress Backup Files” checkbox
    untick the “Enable Scheduled Database
   Backups” checkbox (click on the “Save settings” button)
 * AND
 * if it exists, manually delete the wp-content/uploads/ithemes-security/backup.
   lock folder.
 * AND
 * clear (to regain diskspace) any duplicate .sql and .zip files in the wp-content/
   uploads/ithemes-security/backups folder.
    (You can keep 1, the most recent .sql
   file).
 * dwinden
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518114)
 * For debugging purposes it is much easier to use the “Create Database Backup” 
   button from the Backups page instead of scheduling backups.
 * After following my previous instructions first try this way to create a database
   backup. With the recommended Backup settings it will produce a single .sql backup
   file.
 * If the backup gets created successfully then tick the “Compress Backup Files”
   checkbox and Save settings.
 * Again test using the “Create Database Backup” button from the Backups page. It
   should create the .sql backup file + a .zip file.
    If it fails we now have a 
   good chance of getting an error displayed.
 * dwinden
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518115)
 * Thanks, I’ll debug the manual backup.
 * Here are the values you requested earlier:
    PHP Memory Usage: 61.09 MB PHP Memory
   Limit: 256M PHP Max Script Execution Time: 300 Seconds
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518116)
 * Ok, so I just ran the manual backup and it seems to work both with and without
   zip compression.
 * Manual run:
    `-rw-r--r-- 1 apache apache 4861954 Feb 10 16:17 backup-tc-1423585049-
   6pjNeP75.zip`
 * Scheduled run:
 *     ```
       -rw-r--r-- 1 apache apache 40170999 Feb 10 16:19 backup-tc-1423585165-2mflN1M.sql
       -rw-r--r-- 1 apache apache        0 Feb 10 16:19 backup-tc-1423585165-2mflN1M.zip
       ```
   
 * I’ll keep looking for an easier way to reproduce the issue.
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518117)
 * This command never returns:
    `$zip->create( $itsec_globals['ithemes_backup_dir'].'/'.
   $file . '.sql' );`
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518118)
 * Increasing PHP’s memory_limit fixed the issue.
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518119)
 * Ah, great !
 * Just to be precise. Is the indicated php command (which is very familiar to me)
   hanging ?
 * The reason why I ask is because this command is used in an ‘if’
    construction(**
   without an ‘else’ !** which I think is a bug).
 * The complete command is:
 *     ```
       if ( $zip->create( $itsec_globals['ithemes_backup_dir'] . '/' . $file . '.sql' ) != 0 ) {
   
       ...
   
       }
       ```
   
 * Can you let me know whether a value of 0 is returned or not when the command 
   fails ?
    If so I think this issue (which is reported many many many times in 
   the past) can be handled better by adding an ‘else’ to the if statement.
 * dwinden
 *  [jrcarlsen](https://wordpress.org/support/users/jrcarlsen/)
 * (@jrcarlsen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518120)
 * I removed it from the if statement like this:
 *     ```
       $value = $zip->create( $itsec_globals['ithemes_backup_dir'] . '/' . $file . '.sql' );
       file_put_contents($debugfile, "zip->create: $value\n", FILE_APPEND | LOCK_EX);
       if ( $value != 0 ) {
           file_put_contents($debugfile, "mark_4\n", FILE_APPEND | LOCK_EX);
   
           //delete .sql and keep zip
           @unlink( $itsec_globals['ithemes_backup_dir'] . '/' . $file . '.sql' );
   
           $fileext = '.zip';
       }
       ```
   
 * My debug line was never called, so I assume the script got terminated in $zip-
   >create
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518121)
 * Ok, so the conclusion is that execution of the backup script is halted on the
   $zip->create() command. Probably because of a memory issue.
    So adding an else
   statement to the code won’t make any difference.
 * Thank you for your clarification 😉
 * dwinden

Viewing 14 replies - 31 through 44 (of 44 total)

[←](https://wordpress.org/support/topic/multiple-backups-1/page/2/?output_format=md)
[1](https://wordpress.org/support/topic/multiple-backups-1/?output_format=md) [2](https://wordpress.org/support/topic/multiple-backups-1/page/2/?output_format=md)
3

The topic ‘multiple backups?’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 44 replies
 * 3 participants
 * Last reply from: [dwinden](https://wordpress.org/support/users/dwinden/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/page/3/#post-5518121)
 * Status: not resolved