blse2-public/common-debian/templates/var/backups/timestamp.sh.j2

12 lines
306 B
Plaintext
Raw Normal View History

2023-05-05 15:47:27 -04:00
#!/bin/bash
# Writes timestamps on successful BackupPC completion and updates dynamic share inventory for this host
# {{ ansible_managed }}
OK="$1"
SHARE="$2"
grep -F "${SHARE}" /var/backups/shares || echo "${SHARE}" >> /var/backups/shares
if [[ ${OK} -eq 1 ]]; then
/bin/date +%s > ${SHARE}/.backup
fi