I have Backup and Migrate running on a number of websites. The schedules I have set up are configured with the smart delete option, and a range of backup frequencies. Recently when checking the backup directories for the different sites I noticed that smart delete was deleting to many files. It appears to only be saving files of the most frequent backup period. e.g. if set to backup daily it will save the daily backups but not the weekly ones, if set to backup hourly it will save the hourly ones but not the daily or weekly ones. From my understanding of the code the issue appears to be with the time reference being now (i.e. a sliding point through time) and the backups being a fixed time. Inevitably backups find themselves in the gap between being saved by the hourly period and being saved by the daily period and get deleted. This patch takes a different approach and uses the first backup as the reference time for saving future backups. This patch is currently running successfully on three production sites.
P.S. I have no idea how to propose that this patch be added to the main branch, so any advice on that matter would be appreciated.
Comment | File | Size | Author |
---|---|---|---|
#9 | backup_migrate-smart-delete-not-saving-2606586-9.patch | 3.59 KB | Darren Oh |
|
Comments
Comment #2
dmargetts CreditAttribution: dmargetts commentedComment #3
Darren OhComment #4
joelpittet@dmargetts could you recreate that patch with 2 space indents so dreditor doesn't have a fit?
https://www.drupal.org/coding-standards#indenting
Comment #5
Darren OhI have reformatted the patch.
Comment #6
bjcooper CreditAttribution: bjcooper commentedThe patch in #5 seems to work for me! I hope we can get this reviewed and committed—finding out there weren't any daily backups was an unpleasant surprise.
Comment #7
dddbbb CreditAttribution: dddbbb as a volunteer commentedThe patch in #5 isn't working in my test where we appear to now be retaining hourly backups beyond 24 hours ago.
Comment #8
couturier CreditAttribution: couturier as a volunteer commentedI'm not sure what to tell you as far as getting this patch committed. You might try the new 7.x-3.2 version that was released September 27, 2017, to see if it affects the issue. The previous maintainers for Backup and Migrate have ceased supporting this module, and a new maintainer is focusing efforts on the port to D8, so resources for fixing the 7.x branch are limited. You can expect a stable release for D8 soon if you're migrating sites.
Comment #9
Darren OhRe-rolled patch.
Comment #10
DamienMcKennaThanks for the reroll, Darren.
Comment #11
solideogloria CreditAttribution: solideogloria commentedPatch #5 was tested on PHP 7.2, but patch #9 is on PHP 7.1. Is this intentional?
Also, I've been using patch #5 for 18 months, and it seems to keep the daily and weekly backups properly in addition to the hourly, whereas on a site that I don't use it, I still have the issue. So I'd say I consider the patch to be tested.
Comment #12
Darren OhThe PHP version is not related to a patch’s failure to apply. If it fails to apply, no tests are run. Patch #9 is just a re-roll of patch #5 to get it apply to the current code. It had not been committed because no one updated the status of this issue. If patch #5 has been working for you, please update the status of this issue to Reviewed & tested by the community.
Comment #13
DamienMcKennaThanks for the updates.
Comment #15
DamienMcKennaCommitted. Thanks all!
Comment #17
bmango CreditAttribution: bmango commentedIs there any possiblity there could be a new release of a production version for Backup and Migrate 7? Just because the current production version 7.x-3.6 does not include the fix for Smart Delete. I think quite a few sites are affected by this, mine included. I was hoping to retrieve data from a few months ago but realised it was not possible. When people see the new production version they can automatically update their version whereas they won't know about the change if it is just in dev. :)
Comment #18
bmango CreditAttribution: bmango commentedThank you for commiting the patch to dev btw!