Skip to content

Commit

Permalink
Merge pull request #2410 from gozora/master
Browse files Browse the repository at this point in the history
Evaluate OUTPUT_LFTP_OPTIONS at the beginning of lftp operations.
  • Loading branch information
gozora committed May 28, 2020
2 parents eb482df + cb85788 commit 93827b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions usr/share/rear/output/PXE/default/820_copy_to_net.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ case "$scheme" in
# RESULT_FILES into last available directory in the path.
# e.g. OUTPUT_URL=sftp://<host_name>/iso/server1 and have "/iso/server1"
# directory missing, would upload RESULT_FILES into sftp://<host_name>/iso/
lftp -c "open $OUTPUT_URL; mkdir -fp ${path}"
lftp -c "$OUTPUT_LFTP_OPTIONS; open $OUTPUT_URL; mkdir -fp ${path}"

LogPrint "Transferring file: $result_file"
lftp -c "open $OUTPUT_URL; $OUTPUT_LFTP_OPTIONS mput $result_file" || Error "lftp failed to transfer '$result_file' to '$OUTPUT_URL' (lftp exit code: $?)"
lftp -c "$OUTPUT_LFTP_OPTIONS; open $OUTPUT_URL; mput $result_file" || Error "lftp failed to transfer '$result_file' to '$OUTPUT_URL' (lftp exit code: $?)"
done
;;
(rsync)
Expand Down
6 changes: 3 additions & 3 deletions usr/share/rear/output/default/950_copy_result_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ case "$scheme" in
# FIXME: Verify if usage of $array[*] instead of "${array[@]}" is actually intended here
# see https://github.com/rear/rear/issues/1068
LogPrint "Copying result files '${RESULT_FILES[*]}' to $scheme location"
Log "lftp -c open $OUTPUT_URL; $OUTPUT_LFTP_OPTIONS mput ${RESULT_FILES[*]}"
Log "lftp -c $OUTPUT_LFTP_OPTIONS; open $OUTPUT_URL; mput ${RESULT_FILES[*]}"

# Make sure that destination directory exists, otherwise lftp would copy
# RESULT_FILES into last available directory in the path.
# e.g. OUTPUT_URL=sftp://<host_name>/iso/server1 and have "/iso/server1"
# directory missing, would upload RESULT_FILES into sftp://<host_name>/iso/
lftp -c "open $OUTPUT_URL; mkdir -fp ${path}"
lftp -c "open $OUTPUT_URL; $OUTPUT_LFTP_OPTIONS mput ${RESULT_FILES[*]}" || Error "lftp failed to transfer '${RESULT_FILES[*]}' to '$OUTPUT_URL' (lftp exit code: $?)"
lftp -c "$OUTPUT_LFTP_OPTIONS; open $OUTPUT_URL; mkdir -fp ${path}"
lftp -c "$OUTPUT_LFTP_OPTIONS; open $OUTPUT_URL; mput ${RESULT_FILES[*]}" || Error "lftp failed to transfer '${RESULT_FILES[*]}' to '$OUTPUT_URL' (lftp exit code: $?)"
;;
(rsync)
# If BACKUP = RSYNC output/RSYNC/default/900_copy_result_files.sh took care of it:
Expand Down

0 comments on commit 93827b2

Please sign in to comment.