Closed (fixed)
Project:
Backup and migrate prune
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2013 at 09:20 UTC
Updated:
26 Dec 2018 at 17:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
stred commentedI see a requirement in the .info file
php = 5.2.0
but the function DateTime::setTimestamp() used on Gardener.php line 163 requires 5.3
Comment #2
stred commentedone last thing, I don't know if it is related to my version of php but I receive errors
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in xxx/backup_migrate_prune/class/Gardener.php on line 60
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in xxx/backup_migrate_prune/class/Gardener.php on line 70
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in xxx/backup_migrate_prune/class/Gardener.php on line 159
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in xxx/backup_migrate_prune/class/Gardener.php on line 162
Comment #3
e0ipsoMeanwhile the use of DateTime::setTimestamp() can be circumvented easily, we would face the same with methods like DateTime:diff().
I will update the php requirement, thanks for the report.
You'll find the patch attached here.
Comment #4
donaldwbabcock commentedI have encountered the same issue, and the same error message.
PHP is 5.2.6
Is there an effort to make adjustments to be 5.2 compatible?
Comment #5
e0ipsoI don't think it will happen, since many of the most important features rely on php 5.3
Comment #6
e0ipsoComment #7
organicwire commentedI faced the problem as well, having only php 5.2.x on our server and running still D6 on some sites.
The following script (very very lightweight) does a simplified prune without any drupal dependencies. Simply run from the command line.
clean_bam_files.php /var/www/myproject/sites/default/files/backup_migrate/scheduledIt deletes the following way:
- today: keep all backups
- this & last week: keep one backup per day
- all the rest: keep one backup per week
Find the code on Github
Comment #8
e0ipsoNOTE: The script in #7 will only work under specific circumstances (you need an special naming pattern, it only works for backups stored in disk locally where the script is running, won't discriminate different backup sources, …).
I recommend to anyone willing to use the script above to read the code and understand what it's actually doing before running it, and backup your backups just in case.
If your use case matches what's expected by
clean_bam_files.phpthen it can be a non-Drupal lightweigh alternative.Thanks @organicwire for sharing!!
Comment #9
organicwire commented@e0ipso: thanks for your notes. I added them to the readme file.
As the script in #7 runs in a simulation mode by default, you can actually try it without reading and understanding the code.
Comment #10
jacob.embree commentedThis was fixed by 27686/146c81a6a4cd8688c697bd21ab536a996f0f027e.