From 606978754c4817924084a90caaab99edbafc882e Mon Sep 17 00:00:00 2001 From: Andrew Stowell Date: Wed, 29 Apr 2020 18:26:31 +0000 Subject: [PATCH] new cron to log backup files. --- config.example.sh | 2 ++ crons/backup-log.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 crons/backup-log.sh diff --git a/config.example.sh b/config.example.sh index 88e013b..d408fb1 100644 --- a/config.example.sh +++ b/config.example.sh @@ -10,6 +10,8 @@ declare -A STORAGE_ALERT # storage in GiB STORAGE_ALERT=(["/"]=5) +BACKUP_DIRECTORY="/home/ubuntu/data" + # when set to 0, all backups are kept PRUNE_DOWN_TO=0 diff --git a/crons/backup-log.sh b/crons/backup-log.sh new file mode 100755 index 0000000..a138f68 --- /dev/null +++ b/crons/backup-log.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +LOCATION=`dirname "$0"` + +source "${LOCATION}/../config.sh" + +cd "${BACKUP_DIRECTORY}" + +backups=`find * -type f | xargs du -h` +echo "${backups}" +${LOCATION}/../discord.sh general "${backups}" + +hashes=`find * -type f | xargs md5sum` +echo "${hashes}" +${LOCATION}/../discord.sh general "${hashes}" +