new default for logfile

This commit is contained in:
Felix Lohmeier 2020-07-31 18:15:24 +02:00
parent df3d92a7de
commit 6a386f97e0
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# bash-refine v1.2.2: bash-refine.sh, Felix Lohmeier, 2020-07-31 # bash-refine v1.3.0: bash-refine.sh, Felix Lohmeier, 2020-07-31
# https://gist.github.com/felixlohmeier/d76bd27fbc4b8ab6d683822cdf61f81d # https://gist.github.com/felixlohmeier/d76bd27fbc4b8ab6d683822cdf61f81d
# license: MIT License https://choosealicense.com/licenses/mit/ # license: MIT License https://choosealicense.com/licenses/mit/
@ -16,7 +16,7 @@ else
workdir="${REFINE_WORKDIR}" workdir="${REFINE_WORKDIR}"
fi fi
if [[ -z "${REFINE_LOGFILE}" ]]; then if [[ -z "${REFINE_LOGFILE}" ]]; then
logfile="${workdir}/${date}.log" logfile="log/${date}.log"
else else
logfile="${REFINE_LOGFILE}" logfile="${REFINE_LOGFILE}"
fi fi
@ -226,6 +226,6 @@ function init {
requirements requirements
# set trap, create directories and tee to log file # set trap, create directories and tee to log file
trap 'error "script interrupted!"' HUP INT QUIT TERM trap 'error "script interrupted!"' HUP INT QUIT TERM
mkdir -p "${workdir}" mkdir -p "${workdir}" "$(dirname "${logfile}")"
exec &> >(tee -i -a "${logfile}") exec &> >(tee -i -a "${logfile}")
} }

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# bash-refine v1.2.2: minimal.sh, Felix Lohmeier, 2020-07-31 # bash-refine v1.3.0: minimal.sh, Felix Lohmeier, 2020-07-31
# https://gist.github.com/felixlohmeier/d76bd27fbc4b8ab6d683822cdf61f81d # https://gist.github.com/felixlohmeier/d76bd27fbc4b8ab6d683822cdf61f81d
# license: MIT License https://choosealicense.com/licenses/mit/ # license: MIT License https://choosealicense.com/licenses/mit/

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# bash-refine v1.2.2: templates.sh, Felix Lohmeier, 2020-07-31 # bash-refine v1.3.0: templates.sh, Felix Lohmeier, 2020-07-31
# https://gist.github.com/felixlohmeier/d76bd27fbc4b8ab6d683822cdf61f81d # https://gist.github.com/felixlohmeier/d76bd27fbc4b8ab6d683822cdf61f81d
# license: MIT License https://choosealicense.com/licenses/mit/ # license: MIT License https://choosealicense.com/licenses/mit/
@ -24,7 +24,7 @@ source bash-refine.sh
#memory="1400M" # increase to available RAM #memory="1400M" # increase to available RAM
#date="$(date +%Y%m%d_%H%M%S)" #date="$(date +%Y%m%d_%H%M%S)"
#workdir="output/${date}" #workdir="output/${date}"
#logfile="${workdir}/${date}.log" #logfile="log/${date}.log"
#csrf=true # set to false for OpenRefine < 3.3 #csrf=true # set to false for OpenRefine < 3.3
#jq="jq" # path to executable #jq="jq" # path to executable
#refine="openrefine/refine" # path to executable #refine="openrefine/refine" # path to executable