Viewing 15 replies - 1 through 15 (of 44 total)
  • Thread Starter alfredopacino

    (@alfredopacino)

    up?

    Thread Starter alfredopacino

    (@alfredopacino)

    just rechecked, still not solved

    ‘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

    (@alfredopacino)

    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.

    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

    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

    (@alfredopacino)

    Disable File Locking is disabled. Here my whole setting page
    https://www.diigo.com/item/image/51ynl/qt1e

    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

    (@alfredopacino)

    .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??

    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

    (@alfredopacino)

    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
    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?

    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

    (@alfredopacino)

    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";
    }
    ?>

    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:

    https://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

    (@alfredopacino)

    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)
  • The topic ‘multiple backups?’ is closed to new replies.