Package: ftpsync Version: 20171018 Severity: important
--- Please enter the report below this line. ---There is an error, a compatibility issue, and a fix for me for the "ftpsync" script attached.
Error:The program call in line 590 contains too many "which lead to a script error if the variable RSYNC contains a space. For example, RSYNC = "/usr/bin/socksify /usr/bin/rsync"
Compatibility problem:Not every Linux OS supports the -E parameter with sed. It is better to use the GNU compatible option -r, which gives the same result.
Improvement:Running the program through a (Socks) proxy whose timeout is less than 3600 seconds may cause Stage2 to crash. The timeout should be customizable with its own variable in the configuration.
Original Text:Es sind hier ein Fehler, ein Kompatibilitätsproblem und eine Verbesserung von mir für das Skript "ftpsync" im Anhang enthalten.
Fehler:Der Programmaufruf in Zeile 590 enthält zuviele " die zu einem Skriptfehler führen, wenn die Variable RSYNC ein Leerzeichen enthält. Zum Beispiel RSYNC="/usr/bin/socksify /usr/bin/rsync"
Kompatibilitätsproblem:Nicht jedes Linux OS unterstützt bei sed den Parameter -E. Besser ist es hier die GNU kompatible Option -r zu verwenden, die das selbe ergibt.
Verbesserung:Wird das Programm über einen (Socks) Proxy betrieben, dessen Timeout kleiner 3600 Sekunden ist, kann es zu einem abbruch bei der Stage2 führen. Der Timeout sollte mit einer eigenen Variable in der Konfiguration anpassbar sein.
--- System information. --- Architecture: Kernel: Linux 4.13.0-1-amd64 Debian Release: buster/sid --- Package information. --- Package's Depends field is empty. Package's Recommends field is empty. Package's Suggests field is empty.
ftpsync-bw.gz
Description: application/gzip
36c36 < VERSION="20171018" --- > VERSION="20171018-Bw" 590c590 < "${_RSYNC[@]}" ${RSYNC_OPTIONS} "$@" \ --- > ${_RSYNC[@]} ${RSYNC_OPTIONS} $@ \ 664c664 < sed -Ene 's#.*/binary-([^/]+)$#\1#p; s#.*/(source)$#\1#p' | sort -u | tr '\n' ' ') --- > sed -rne 's#.*/binary-([^/]+)$#\1#p; s#.*/(source)$#\1#p' | sort -u | tr '\n' ' ') 680c680 < for bytes in $(sed -Ene 's/^sent ([0-9]+) bytes received ([0-9]+) bytes.*/\1/p' "${LOGDIR}/rsync-${NAME}.log"); do --- > for bytes in $(sed -rne 's/^sent ([0-9]+) bytes received ([0-9]+) bytes.*/\1/p' "${LOGDIR}/rsync-${NAME}.log"); do 870a871,874 > > # Connection Timeout (Keepalive Pakets Timeout/2) > RSYNC_TIMEOUT=${RSYNC_TIMEOUT:-3600} > 872c876 < RSYNC_OPTIONS=${RSYNC_OPTIONS:-"-prltvHSB8192 --safe-links --chmod=D755,F644 --timeout 3600 --stats --no-human-readable"} --- > RSYNC_OPTIONS=${RSYNC_OPTIONS:-"-prltvHSB8192 --safe-links --chmod=D755,F644 --timeout ${RSYNC_TIMEOUT} --stats --no-human-readable"} 874c878 < RSYNC_OPTIONS=${RSYNC_OPTIONS:-"-prltvHSB8192 --safe-links --timeout 3600 --stats --no-human-readable"} --- > RSYNC_OPTIONS=${RSYNC_OPTIONS:-"-prltvHSB8192 --safe-links --timeout ${RSYNC_TIMEOUT} --stats --no-human-readable"}