KIEKjes Upload System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
359 B

set -e
# no built-in tar support, write to a temporary directory first
mkdir -p "$tempdir"
trap 'rm -r "$tempdir"' EXIT INT TERM
# use printf to built a nice lftp cmdline in one go, fetch, and tar!
server="$1"; shift
lftp -c "connect $server && lcd $tempdir $(printf " && get %s" "$@")"
(cd "$tempdir" && tar -cz -- "$@")