What about to replace mput to generated put
?
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd /home/dbadmin/backup
$(find *.gz -maxdepth 0 -type f -printf 'put %p\n')
quit
END_SCRIPT
How it works:
When HERE-IS-DOCUMENT will be resolved, find *.gz ...
will generate multiple lines for each file found by mask *.gz
:
put 1.gz
put 2.gz
...
and your script content that will be executed by ftp
will be like that:
quote USER your_user_name
quote PASS your_passwd
cd /home/dbadmin/backup
put 1.gz
put 2.gz
...
quit
Regarding /home/dbadmin: Is a directory
I belive you have single line /home/dbadmin
in your script (or something like $SOME_COMMAND /home/dbadmin
).