#431 Issue closed: Rear lftp+cfg2html

Labels: enhancement, bug

tyl0re opened issue at 2014-06-25 14:51:

Version 1.16
Server: SLES11 Sp3
Presinstalled: cfg2html

In /usr/share/rear/output/default/95_copy_result_files.sh
Line:38
lftp -c "open $OUTPUT_URL; mput ${RESULT_FILES[@]}"

Seems to execute

lftp -c 'open http://Server/call; mput 1.html' 1.iso
that results in Command not found

Somehow bash mask wrong when giving him an array

Same Error Can be produced with an shell script:

#!/bin/bash -x
export OUTPUT_URL="http://SERVER1/upload/"
RESULT_FILES=( "/var/lib/rear/recovery/cfg2html/SERVER1.html" "/var/lib/rear/output/rear-SERVER2.iso" )
lftp -c "open $OUTPUT_URL; mput "${RESULT_FILES[@]}""
--------------------------
Solution:
X=`echo "${RESULT_FILES[@]}"`
lftp -c "open $OUTPUT_URL; mput $X"

When de-installing cfg2html, it works since the array has only one entry

schlomo commented at 2014-06-25 18:15:

Might be a case for using [*] instead of [@], at the loss of beeing able to
handle files with blanks in them.

On 25 June 2014 16:56, tyl0re notifications@github.com wrote:

Closed #431 https://github.com/rear/rear/issues/431.


Reply to this email directly or view it on GitHub
https://github.com/rear/rear/issues/431#event-135050342.

tyl0re commented at 2014-06-25 18:27:

Is there a case where a where blanks could be in the file names?
Normally the names are rear-$hostname.iso rear-$hostname.html

gdha commented at 2014-06-26 06:37:

@tyl0re Have you tried the suggestion of @schlomo ?

tyl0re commented at 2014-06-26 06:44:

Yes , just that moment has worked...

gdha commented at 2014-06-26 06:48:

@tyl0re to confirm you tested: lftp -c "open $OUTPUT_URL; mput ${RESULT_FILES[*]}" , right?

tyl0re commented at 2014-06-26 06:59:

yes


[Export of Github issue for rear/rear.]