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 15 replies - 1 through 15 (of 44 total)

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

 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5517963)
 * up?
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518067)
 * just rechecked, still not solved
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518069)
 * ‘Backups to Retain’ setting is disabled when set to 0.
    So currently all backups
   are retained …
 * Change it to > 0 (eg 1 if you only want 1 backup retained).
 * If this solves your issue please mark your topic as “Resolved”.
 * dwinden
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518070)
 * no, as I said, even if I disable iThemes Security and I manually delete those
   backups via ftp, if I enable the plugin again in few hours I’ll find multiple
   backups (until my 1.1GB of web space is full..)
    The same with Backups to Retain
   =1.
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518071)
 * Ah ok, I now understand better what you mean.
    (Can’t remember you said that 
   though …)
 * Please provide me an overview of all of your current iTSec Database Backup settings:
   
   Backup Full Database Backup Method Backup Location Backups to Retain Compress
   Backup Files Exclude Tables Enable Scheduled Database Backups (Backup Interval)
 * And are you using WordPress Dashboard in a non English language ?
    If so what
   language are you using ? Are you using WP 4.1 and iTSec plugin 4.6.2 version ?
   Could you make a screenshot available showing a detailed list of the backup files
   created (showing details like file name, creation date, size etc) ? Can you determin\
   see whether the existing backup files actually contain a valid\completed database
   backup ? Are you also receiving emails for every backup file created ? If you
   are using Apache as a webserver are there any errors in the error_log ?
 * dwinden
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518072)
 * I forgot one other important setting.
    Is the “Disable File Locking” checkbox
   ticked or not in iTSec Settings tab\menu option “Global Settings” section ?
 * dwinden
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518073)
 * Disable File Locking is disabled. Here my whole setting page
    [https://www.diigo.com/item/image/51ynl/qt1e](https://www.diigo.com/item/image/51ynl/qt1e)
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518074)
 * Ok, good.
 * Let’s go throught the iTSec scheduled backup workflow with your Backup Settings:
 * User accesses website homepage:
    if current_time_gmt – interval > last_run then
   the scheduled backup is triggered\started … (Yes USERS trigger the SCHEDULED 
   backup simply by accessing the website !)
 * “Backup Method” is “Email Only” so “Retain Backup Files” setting is not relevant…
 * *.lock locking directory is created …
    iTSec backup creates (temporary) .sql 
   backup file and “Compress Backup Files” checkbox is enabled so using .sql file
   iTSec also creates (temporary) .zip file then .sql file is deleted then email
   is send with .zip attachment then .zip file is deleted last_run = current_time_gmt
   and saved in database finally log entry added for backup *.lock locking directory
   is deleted … DONE
 * So why do backup file(s) still exist after backup procedure completed
    (without
   any errors\warnings displayed) ?
 * Perhaps deleting .sql and\or .zip files is not working in your env …
    Code used
   by iTSec to delete .sql and\or .zip files is:
 * @unlink( $itsec_globals[‘ithemes_backup_dir’] . ‘/’ . $file . ‘.sql’ );
    @unlink(
   $itsec_globals[‘ithemes_backup_dir’] . ‘/’ . $file . $fileext ); (where $fileext
   =’.zip’)
 * Notice the @ sign in front of the unlink command !
    @ means if the unlink command
   fails no error\warning is displayed ! (Perhaps there is an error displayed in
   the Apache error_log…)
 * So what backup files still exist ? Only .sql or only .zip or both ?
    And are 
   you receiving emails with the .zip backup file as attachment ? Last but not least
   what is the size of the .sql and\or .zip files ?
 * dwinden
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518075)
 * .sql and .zip both.
    Anyway I just noticed that email setting, I don’t need that.
   I just want to be sure a single backup is functional and updated on my webspace(
   besides I’m not the owner so I don’t receive that email)
 * So I set Backup Method “save Locally only”
    Maybe this issue is caused by some
   hosting send mail issue (I’m having some problems sending newsletter..)
 * ps: This plugin saves just the db or the files too??
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518076)
 * Ok, that way the “Retain Backup Files” setting also comes back into play.
    Allthough“
   Retain Backup Files” deletes files using the same @unlink command… so don’t be
   surprised if it makes no difference …
 * Could be a permission issue. Are you on a Linux or Windows hosting env ?
 * Perhaps you are right and it’s the email causing problems …
    I guess you’ll find
   out soon enough … let me know when you do 😉
 * I’m not sure I understand your last question but most settings are saved in the
   database as options. But there are also changes applied to wp-config.php and .
   htaccess files.
 * dwinden
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518077)
 * Actually the last times I activated ithemes security the plugins duplicated backups
   until the space goes over (so I was forced to delete the backups and disable 
   the plugin), now in few hours I have no backup.
    Since I set 1 backup per day,
   I guess I have to wait 24 hours to know if it works properly or not. 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 :/
 * I don’t think is a permission issue: the backups were created (there was too 
   many of them but they were here..) also the backup directory have 775 mode.
 * About the last question: a website is made up by a database and files (script,
   images).. my quesiton is: this plugin makes backup just for the db?
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518078)
 * Ok, so it looks like you are making some progress …
 * You can manipulate the last_run value which is stored in the database.
    This 
   way you don’t have to wait a full day to trigger a new scheduled backup. Login
   to the database using phpMyAdmin and then execute the following SQL command:
 * select * from [prefix]options where option_name = ‘itsec_backup’;
 * (where [prefix] must be substituted with your table prefix).
 * Doubleclick on the resulting option_value to edit.
    Look for s:8:”last_run”;i:
   1422118143; You will probably have a slightly different value. Interval = One
   day = 24*60*60 = 86400 seconds Replace 1422118143 with 1422118143-86400=1422031743
   seconds. This is just an example, you will need to calculate with your last_run
   value. Click anywhere outside the cell to save the change.
 * Now access your website home page and the scheduled backup will automatically
   be triggered. Assuming “Retain Backup Files” = 1 there should only be one, just
   created, .zip file in the ithemes_security/backups directory and the previous
   one should be gone …
 * Please create a new topic in the forum for the blank page issue when clicking
   on the “Create Database Backup” button on the Backups tab.
    It’s a one-time backup
   which is different from a scheduled backup. I’ll try and respond to it there.
 * With a simple test.php file which creates a file in the same location and then
   tries to delete it using an unlink command (without @) will show you whether 
   this is a permission issue or not.
 * Any info on the size of those .sql/.zip files ? I guess it’s on a Linux env ?
   (
   Perhaps there are errors displayed in the Apache error_log…)
 * The iTSec plugin indeed only makes a backup of the DB.
    The iTSec plugin web 
   files can always be restored reinstalling the plugin.
 * dwinden
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518080)
 * after more than 24h I have a .zip file with size 0 “backup-my-site-name-1422212278-
   q1xiMCp.zip”.
 * this is my working test script, please note $homedir
    $_SERVER[‘DOCUMENT_ROOT’]
   doesn’t works fine on my free hosting. in this way fopen and unlink works.
 *     ```
       <?php 
   
       $homedir = substr( $_SERVER['SCRIPT_FILENAME'],0,-strlen($_SERVER['SCRIPT_NAME']) ).'/';
       $filename =$homedir.'wp-content/uploads/ithemes-security/backups/'.'test.txt';
       $fh = fopen($filename, "w");
               if($fh==false)
                   die("unable to create file");
               $state=fputs ($fh, "hello i'm a little string and i'm pretty sure i will be in test.txt");
       		if($state==false) echo "fputs problem";
       		else echo "file created and filled";
   
       	//phpinfo();
   
       if(isset($_GET['remove'])){
       if(unlink($filename)) echo "<br>removed"; else echo "<br>remove error";
       }
       ?>
       ```
   
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518081)
 * Ik think “.zip file with size 0 “backup-my-site-name-1422212278-q1xiMCp.zip” 
   is the key to the solution of this issue.
    **The problem is probably with zipping
   NOT with unlink command !**
 * According to:
 * [http://www.phpconcept.net/pclzip/faq#faq01](http://www.phpconcept.net/pclzip/faq#faq01)
 * Q1 : While creating an archive with PclZip, the script terminates with an empty
   created zip archive, why ?
 *  The behavior was encounter while the zlib extension is not enabled with the 
   PHP installation. PclZip uses the compression functions from the zlib. In next
   releases of PclZip (1.1+) a systematic control of the zlib presence will be done.
 * To check whether zlib extension is loaded in PHP on Linux execute:
 *     ```
       <?php
       if(extension_loaded('zlib')) {
       	echo "zlib extension loaded !";
       }
       else {
       	echo "zlib extension not available !";
       }
       ?>
       ```
   
 * (Windows PHP has build in zlib support since PHP 4.3.0)
 * BUT even when PHP zlib extension is available there are also some PHP directives
   that need to be set to high enough values in case backup files are BIG. Check
   your values in iTSec Dashboard under “PHP Information”:
 * – PHP Memory Limit (memory_limit –> default 8M)
    – PHP Max Script Execution Time(
   max_execution_time –> default 30 sec)
 * ALSO I discovered there is a bug in the iTSec backup code …
    First check the 
   above in your env. I’ll explain later about the bug in iTSec backup code.
 * dwinden
 *  Thread Starter [alfredopacino](https://wordpress.org/support/users/alfredopacino/)
 * (@alfredopacino)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/multiple-backups-1/#post-5518082)
 * your script prints “zlib extension loaded !”
 * PHP Memory Limit: 128M
 * PHP Max Script Execution Time: 30 Seconds.
 * Now I turned off “Compress Backup Files”..I will see what’s happen..

Viewing 15 replies - 1 through 15 (of 44 total)

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

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