Bash script to ftp only files of type gz in current directory

I have a bash manuscript that cd to the appropriate directory site after that makes use of the mput command to ftp all the files in the directory site to a remote server, as listed below:

for from_dir in $DATE_LIST 
do
    cd ${FILE_LANDING_DIR}/deltas/${from_dir}
    ftp_files
done

ftp_files () {
    ftp -inv $HOST <<-EOF > $LOG_DIR/tempftplog
    user $USER $PASS 
    cd ${ID_LANDING_DIR}
    mput *
    bye 
    EOF
} 

I attempted modifying the ftp_files function to ftp just the .gz files because directory site by transforming the line from mput * to mput *.gz yet that did not function.

Can a person inform me just how I can do this as soon as in the ftp command?

1
2022-06-07 14:32:17
Source Share
Answers: 2

Does mput *.gz not function? Otherwise, attempt the ftp glob command first.

http://man.cx/ftp

0
2022-06-07 14:51:05
Source

What concerning executing a directory site search and also piping it to the mput?

ls *.gz | mput

I can not examine this now due to the fact that Im not at a linux box so it could require to be fine-tuned to get it to function 100% appropriately.

0
2022-06-07 14:50:23
Source