I have a bash script that cd to the right directory then uses the mput command to ftp all the files in the directory to a remote server, as 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 tried altering the ftp_files function to ftp only the .gz files in that directory by changing the line from mput * to mput *.gz but that did not work.
Can someone tell me how I can do this once in the ftp command?
mput *.gzdid not work? What is the error message you get? – janos Jun 17 '12 at 8:16