aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-12-29 17:06:29 +0100
committerHarald Welte <laforge@osmocom.org>2021-12-29 17:07:22 +0100
commitcce962cdc0aeb9c1d743ed8b4ff12ca075b66e3b (patch)
tree539e8c341b3f6f7944cdc51c9d044c51876dc781
parent0c5869f359c5a8eb4e4a920a08e056dc500e4048 (diff)
obs-mirror.sh: Keep log files of rsync job
Before this commit, the obs-mirror.log was overwritten every night, meaning we have no history of rsync log files. Change-Id: I26392ed8615b9f4a6aa23e92b82ad9aff01eac4b
-rwxr-xr-xcontrib/obs-mirror/obs-mirror.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/obs-mirror/obs-mirror.sh b/contrib/obs-mirror/obs-mirror.sh
index 529aea1..895afac 100755
--- a/contrib/obs-mirror/obs-mirror.sh
+++ b/contrib/obs-mirror/obs-mirror.sh
@@ -9,8 +9,10 @@
#
# See also: OS#4862
-echo "Redirecting all output to: /home/pkgmirror/obs-mirror.log"
-exec >"/home/pkgmirror/obs-mirror.log" 2>&1
+DATE=`date +%Y%m%d-%H%M%S`
+LOGFILE="/home/pkgmirror/obs-mirror-$DATE.log"
+echo "Redirecting all output to: $LOGFILE"
+exec >$LOGFILE 2>&1
set -e -x
SCRIPT_DIR="$(realpath "$(dirname "$(realpath "$0")")")"
@@ -24,7 +26,6 @@ cd "$BASE_DIR"
RSYNC_ARGS="-av --delete"
RSYNC_ARGS="$RSYNC_ARGS --files-from $SCRIPT_DIR/obs-mirror-include.txt --recursive"
-DATE=`date +%Y%m%d-%H%M%S`
DIR="$BASE_DIR/$DATE"
TEMP_DIR="$BASE_DIR/.temp"