Add a backup disk usage analyzer script

This commit is contained in:
Salt 2023-11-11 09:24:48 -06:00
parent 76342928b3
commit 1dbf436a50
2 changed files with 19 additions and 0 deletions

View File

@ -3,6 +3,8 @@
---
- name: template out backup script
ansible.builtin.template: src={{ backup_script }}.sh dest=/opt/backup.sh mode=0700 owner=root group=root
- name: template out analyze script
ansible.builtin.template: src={{ backup_script }}-analyze.sh dest=/opt/analyze.sh mode=0700 owner=root group=root
- name: template out restore script
ansible.builtin.template: src={{ restore_script }}.sh dest=/opt/restore.sh mode=0700 owner=root group=root
- name: configure systemd service

View File

@ -0,0 +1,17 @@
#! /bin/bash
#
# s3backup-analyze.sh
# A companion script to s3backup to analyze disk usage for backups
# NOTICE: DO NOT MODIFY THIS FILE
# Any changes made will be clobbered by Ansible
# Please make any configuration changes in the main repo
exec ncdu \
{% for item in backup_s3backup_list + backup_s3backup_list_extra %}
"{{ item }}" \
{% endfor %}
{% for item in backup_s3backup_exclude_list + backup_s3backup_exclude_list_extra %}
--exclude "{{ item }}" \
{% endfor %}
-r