forked from infra/ansible
Rename retention script per feedback
Signed-off-by: Michael Winters <fedora@mwinters.net>
This commit is contained in:
parent
4fd6c27207
commit
2a941c4482
4 changed files with 10 additions and 6 deletions
|
|
@ -7,4 +7,4 @@ export ANSIBLE_HOST_KEY_CHECKING=False
|
|||
/srv/web/infra/ansible/scripts/public-db-copy >& /dev/null
|
||||
|
||||
# Delete old datanommer-incremental backups
|
||||
/srv/web/infra/ansible/scripts/iso-file-retention /srv/web/infra/db-dumps/datanommer-incremental >& /dev/null
|
||||
/srv/web/infra/ansible/scripts/file-retention-iso-date /srv/web/infra/db-dumps/datanommer-incremental >& /dev/null
|
||||
|
|
@ -143,5 +143,5 @@ echo
|
|||
echo "$(date -Iseconds): export done!"
|
||||
|
||||
echo "Running retention script for '$DESTDIR'..."
|
||||
/usr/local/bin/iso-file-retention "$DESTDIR"
|
||||
/usr/local/bin/file-retention-iso-date "$DESTDIR"
|
||||
echo
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
- postgresql
|
||||
|
||||
|
||||
- name: Copy iso-file-retention script
|
||||
ansible.builtin.copy: src=scripts/iso-file-retention dest=/usr/local/bin/iso-file-retention mode=0755
|
||||
- name: Copy file-retention-iso-date script
|
||||
ansible.builtin.copy: src=scripts/file-retention-iso-date dest=/usr/local/bin/file-retention-iso-date mode=0755
|
||||
tags:
|
||||
- datanommer
|
||||
- postgresql
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
#!/bin/bash
|
||||
# vim: ts=4:sw=4:expandtab:tw=100
|
||||
|
||||
# Deletes files prefixed with ISO dates (YYYY-MM-DD-) older than RETENTION_DAYS days,
|
||||
# but always retains the most-recent MIN_KEEP files even if they're "old".
|
||||
# This script manages a set of backup files which are prefixed with ISO dates (YYYY-MM-DD).
|
||||
# - As new files come in, we want to delete the old ones.
|
||||
# - RETENTION_DAYS decides how old is "old".
|
||||
# - But if no new files come in (e.g. the backup process is broken), we don't want to
|
||||
# end up deleting _all_ the files, just because they're old.
|
||||
# - MIN_KEEP decides how many files to keep.
|
||||
#
|
||||
# Usage: ./retain.sh --dry-run <directory>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue