duplicity - add check script

This commit is contained in:
camille 2023-06-30 16:07:19 +02:00
parent 525b6355e8
commit 6d60bbf200
2 changed files with 16 additions and 0 deletions

View File

@ -6,3 +6,11 @@
owner: root owner: root
group: root group: root
mode: 0640 mode: 0640
- name: backup | add last backup check script
template:
src: check_duplicity.sh.j2
dest: /usr/local/bin/check_duplicity.sh
owner: root
group: root
mode: 0750

View File

@ -0,0 +1,8 @@
# Ansible generated
# Check if backup of the day is present
currenttime=$(date +%H:%M)
if [[ "$currenttime" > "09:00" ]] || [[ "$currenttime" < "23:59" ]]; then
source /etc/duplicity/duplicity.cnf && duplicity collection-status --name {{ duplicity_backup_name }} --archive-dir={{ duplicity_archive_dir }} "{{ duplicity_azure_path }}" |grep 'Full\|Incremental' |grep -i "$(date +"%a %b %d")" |wc -l
else
echo "1"
fi