Skip to content

Commit

Permalink
fix copying files and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Lutz Bender committed Oct 12, 2022
1 parent 553d7b0 commit 97bfb66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion helperFunctions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ openwbDebugLog() {
export -f openwbDebugLog

openwbRunLoggingOutput() {
$1 2>&1 | while read -r line
functionName="$1"
shift
$functionName "$@" 2>&1 | while read -r line
do
# use path to /var/log as link in ramdisk may not be set up yet!
echo "$(date +"%Y-%m-%d %H:%M:%S"): $1: $line" >> "/var/log/openWB.log"
Expand Down
4 changes: 3 additions & 1 deletion runs/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ LOGFILE="$OPENWBBASEDIR/web/tools/upload/restore.log"
fi
echo "****************************************"
echo "Step 4: replacing old files..."
mv -v -f "${WORKINGDIR}${OPENWBBASEDIR}/." "${OPENWBBASEDIR}/"
# we use cp not mv because of not empty directories in destination
# dotglob is needed to include files and directories beginning with a dot
(shopt -s dotglob; sudo cp -v -p -r "${WORKINGDIR}${OPENWBBASEDIR}/"* "${OPENWBBASEDIR}/")
echo "****************************************"
echo "Step 5: restoring mosquitto db..."
if [[ -f "${WORKINGDIR}${MOSQUITTODIR}/mosquitto.db" ]]; then
Expand Down

0 comments on commit 97bfb66

Please sign in to comment.