Commit 7b5ca1ea authored by Vincent Pelletier's avatar Vincent Pelletier

erp5.zeo: Expire backup index after 2 days.

Do not expose a parameter, as index can be reconstructed from data anyway.
Rotating is anyway needed as index backup can take a significant amount of
space for rare practical use.
Also, remove this point from TODO.
parent 44fd2dd9
Release-critical:
- expire repozo FileStorage index backups (can take a lot of space)
General: General:
- varnish/squid - varnish/squid
- enable zope webdav service and provide access through haproxy & backend apache - enable zope webdav service and provide access through haproxy & backend apache
......
...@@ -306,7 +306,7 @@ md5sum = 7735d535aa34dfdc18a776b80bc0ca3d ...@@ -306,7 +306,7 @@ md5sum = 7735d535aa34dfdc18a776b80bc0ca3d
[template-zeo] [template-zeo]
< = download-base < = download-base
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = 537454dcd64330ddb0360c05526b7824 md5sum = 6b99d2712aff3a8a717400a557dc5191
[template-zope] [template-zope]
< = download-base < = download-base
......
...@@ -44,6 +44,7 @@ ipv4 = {{ ipv4 }} ...@@ -44,6 +44,7 @@ ipv4 = {{ ipv4 }}
ipv6 = {{ ipv6 }} ipv6 = {{ ipv6 }}
{% endif -%} {% endif -%}
{% set backup_directory_list = [] -%}
{% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%} {% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%}
{% do storage_dict.setdefault( {% do storage_dict.setdefault(
mountpoint_dict.get('storage-family', 'default').lower(), [] mountpoint_dict.get('storage-family', 'default').lower(), []
...@@ -67,10 +68,12 @@ ipv6 = {{ ipv6 }} ...@@ -67,10 +68,12 @@ ipv6 = {{ ipv6 }}
client_dict, client_dict,
]) -%} ]) -%}
{% if tidstorage_dict != None -%} {% 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__( {% do known_tid_storage_identifier_dict.__setitem__(
json_module.dumps((known_tid_storage_identifier_host, export_id)), ( json_module.dumps((known_tid_storage_identifier_host, export_id)), (
export_storage_dict['path'], 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, mount_point,
), ),
) -%} ) -%}
...@@ -169,6 +172,15 @@ name = tidstorage ...@@ -169,6 +172,15 @@ name = tidstorage
time = {{ dumps(tidstorage_dict.get('periodicity', 'daily')) }} time = {{ dumps(tidstorage_dict.get('periodicity', 'daily')) }}
command = ${tidstorage:repozo-wrapper} 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") }}] [{{ section("logrotate-tidstorage") }}]
< = logrotate-base < = logrotate-base
name = tidstorage name = tidstorage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment