Add log function to backup script:
This commit is contained in:
parent
c8409a00f4
commit
810fccfce2
@ -13,6 +13,12 @@ export TERRARIADIR="{{ terraria_root }}/{{ terraria_name }}"
|
|||||||
export OUTDIR="$TERRARIADIR/backups"
|
export OUTDIR="$TERRARIADIR/backups"
|
||||||
retention=144 # 30-minute intervals, 3 days
|
retention=144 # 30-minute intervals, 3 days
|
||||||
|
|
||||||
|
# Helper functions
|
||||||
|
log() {
|
||||||
|
[ -z "$1" ] && return 1
|
||||||
|
printf "$(date -Iseconds): $1\n"
|
||||||
|
}
|
||||||
|
|
||||||
# Sanity checks
|
# Sanity checks
|
||||||
if ! [ -d "$OUTDIR" ]; then
|
if ! [ -d "$OUTDIR" ]; then
|
||||||
if ! mkdir "$OUTDIR"; then
|
if ! mkdir "$OUTDIR"; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user