diff --git a/.gitignore b/.gitignore index dae8f04..fb14dfa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.log +logs .resticPassword backups.sh restic.sh diff --git a/logs/logFilesGoHere b/logs/logFilesGoHere deleted file mode 100644 index e69de29..0000000 diff --git a/templates/backupsTemplate.sh b/templates/backupsTemplate.sh index dc61ecd..6650c03 100644 --- a/templates/backupsTemplate.sh +++ b/templates/backupsTemplate.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