multiple backups?
-
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.
-
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)
}
}memory_limit is set to 160M
memory_get_peak_usage() reports 82MB on dwinden’s testI 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
i get a blank page :/dwinden
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.
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 Timedwinden
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
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
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 SecondsOk, 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.
This command never returns:
$zip->create( $itsec_globals['ithemes_backup_dir'] . '/' . $file . '.sql' );
Increasing PHP’s memory_limit fixed the issue.
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
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
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
- The topic ‘multiple backups?’ is closed to new replies.