Add log function to backup script:

This commit is contained in:
Salt 2020-05-19 12:14:27 -05:00
parent c8409a00f4
commit 810fccfce2

View File

@ -13,6 +13,12 @@ export TERRARIADIR="{{ terraria_root }}/{{ terraria_name }}"
export OUTDIR="$TERRARIADIR/backups"
retention=144 # 30-minute intervals, 3 days
# Helper functions
log() {
[ -z "$1" ] && return 1
printf "$(date -Iseconds): $1\n"
}
# Sanity checks
if ! [ -d "$OUTDIR" ]; then
if ! mkdir "$OUTDIR"; then