duplicity - add check script
This commit is contained in:
parent
525b6355e8
commit
6d60bbf200
@ -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
|
||||||
|
8
templates/check_duplicity.sh.j2
Normal file
8
templates/check_duplicity.sh.j2
Normal 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
|
Loading…
x
Reference in New Issue
Block a user