diff --git a/stack/erp5/TODO b/stack/erp5/TODO index 0177fd95a1b3dec17ac76a98c79b46bb602b5fd5..ab9e61535cb043ee9ac3608f0fd3af66c3c3c97b 100644 --- a/stack/erp5/TODO +++ b/stack/erp5/TODO @@ -1,6 +1,3 @@ -Release-critical: -- expire repozo FileStorage index backups (can take a lot of space) - General: - varnish/squid - enable zope webdav service and provide access through haproxy & backend apache diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg index cab3490c8bc860c10a44ef2f7769494e6b307e6f..a296f8c98438edf46526ff13c2d157d83c6ba296 100644 --- a/stack/erp5/buildout.cfg +++ b/stack/erp5/buildout.cfg @@ -306,7 +306,7 @@ md5sum = 7735d535aa34dfdc18a776b80bc0ca3d [template-zeo] < = download-base filename = instance-zeo.cfg.in -md5sum = 537454dcd64330ddb0360c05526b7824 +md5sum = 6b99d2712aff3a8a717400a557dc5191 [template-zope] < = download-base diff --git a/stack/erp5/instance-zeo.cfg.in b/stack/erp5/instance-zeo.cfg.in index 171651a9d7e40413dcd69a21c19bd996f0f51bde..eb227e6bc9220a04c6d49afd34364f82dfef605d 100644 --- a/stack/erp5/instance-zeo.cfg.in +++ b/stack/erp5/instance-zeo.cfg.in @@ -44,6 +44,7 @@ ipv4 = {{ ipv4 }} ipv6 = {{ ipv6 }} {% endif -%} +{% set backup_directory_list = [] -%} {% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%} {% do storage_dict.setdefault( mountpoint_dict.get('storage-family', 'default').lower(), [] @@ -67,10 +68,12 @@ ipv6 = {{ ipv6 }} client_dict, ]) -%} {% if tidstorage_dict != None -%} +{% set backup_directory = tidstorage_dict.get('zodb-dict', {}).get(export_id, '%(backup)s/%(name)s') % {'backup': zodb_backup_path, 'name': export_id} -%} +{% do backup_directory_list.append(backup_directory) -%} {% do known_tid_storage_identifier_dict.__setitem__( json_module.dumps((known_tid_storage_identifier_host, export_id)), ( export_storage_dict['path'], - tidstorage_dict.get('zodb-dict', {}).get(export_id, '%(backup)s/%(name)s') % {'backup': zodb_backup_path, 'name': export_id}, + backup_directory, mount_point, ), ) -%} @@ -169,6 +172,15 @@ name = tidstorage time = {{ dumps(tidstorage_dict.get('periodicity', 'daily')) }} command = ${tidstorage:repozo-wrapper} +{% if backup_directory_list -%} +[{{ section("cron-entry-purge-repozo-fsindex") }}] +recipe = slapos.cookbook:cron.d +cron-entries = ${cron:cron-entries} +name = purge-repozo-fsindex +time = ${cron-entry-tidstorage-backup:time} +command = {{ parameter_dict['findutils-location'] }}/bin/find {% for backup_directory in backup_directory_list %}'{{ backup_directory.replace("\\", "\\\\").replace("'", "\\'") }}' {% endfor %}-name "????-??-??-??-??-??.index" -daystart -mtime +2 -delete + +{% endif -%} [{{ section("logrotate-tidstorage") }}] < = logrotate-base name = tidstorage