could you add this requirement somewhere ? I'm unfortunately stuck with php 5.2 and can not use this module...

Comments

stred’s picture

I 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

stred’s picture

one 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

e0ipso’s picture

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

donaldwbabcock’s picture

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

e0ipso’s picture

Status: Active » Closed (won't fix)

I don't think it will happen, since many of the most important features rely on php 5.3

e0ipso’s picture

Status: Closed (won't fix) » Active
organicwire’s picture

I 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/scheduled

It 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

e0ipso’s picture

NOTE: 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.php then it can be a non-Drupal lightweigh alternative.

Thanks @organicwire for sharing!!

organicwire’s picture

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

jacob.embree’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.