linux - Shell - LFTP - multiple extensions -
i have been trying find way use mget
file extensions.
i have used following command (which works fine if leave *.csv
)
lftp -e "set xfer:clobber true;mget $source_dir*.{csv,txt,xls,xlsx,zip,rar};exit" -u $source_username,$source_password $source_server || exit 0
but no luck, message dir/*.{csv,txt,xls,xlsx,zip,rar} no files found
tried add parenthesis
lftp -e "set xfer:clobber true;mget $source_dir(*.{csv,txt,xls,xlsx,zip,rar});exit" -u $source_username,$source_password $source_server || exit 0
also no luck
$source_dir
has slash /
@ end
i tried test lftp locally have problem opening ports on vagrant box, hence question
i managed connect 1 ftp without need forward ports.
turns out (i know seems obvious) have specify full path wildcard each extension
mget $source_dir*.csv $source_dir*.txt
separated space
also if 1 (or more) extensions not found message "*.txt no files found" land in standard error, led me not able proceed full script
Comments
Post a Comment