ansible-role-configure-post.../templates/autopostgresqlbackup_post_script.j2

16 lines
417 B
Text
Raw Normal View History

2024-05-04 12:36:28 +02:00
#!/bin/bash
2024-03-23 21:19:15 +01:00
2024-05-04 12:36:28 +02:00
{{ ansible_managed | comment }}
2023-11-04 13:07:10 +01:00
source /etc/default/autopostgresqlbackup
# available variables:
# strings, i.e. character sequences
echo "$BACKUPDIR"
[ -z "$BACKUPDIR" ] && echo >&2 "Invalid / unknown BACKUPDIR" && exit 1
# Loeschen der alten Backups
find "${BACKUPDIR}/monthly" "${BACKUPDIR}/weekly" "${BACKUPDIR}/daily" -type f -mtime +{{ autopostgresqlbackup_delete_backups_after_days }} -delete