diff --git a/roles/terraria/templates/backup.sh b/roles/terraria/templates/backup.sh index e6a6709..26af286 100644 --- a/roles/terraria/templates/backup.sh +++ b/roles/terraria/templates/backup.sh @@ -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