Update how script handles/sets up logs

release/full-rewrite
capntack 6 months ago
parent 79d1d4b500
commit 55a6c90fb5

1
.gitignore vendored

@ -1,4 +1,5 @@
*.log
logs
.resticPassword
backups.sh
restic.sh

@ -18,6 +18,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
############################
# Setup for logging
mkdir -p "${SCRIPT_DIR}"/logs
exec 3<&1 4<&2
trap "exec 2<&4 1<&3" 0 1 2 3
exec > >(tee >(ts "%Y-%m-%d_%H:%M:%S" > "${BACKUP_LOG}")) 2>&1

Loading…
Cancel
Save