SFTP to server, pulling data and removing the data

Hi all,

I have the following script, but are not too sure about the syntax to complete the script.
In essence, the script must connect to a SFTP server at a client site with username and password located in a file on my server.
Then change to the appropriate directory.
Pull the data to the local directory on my side.
And remove the data on the client side.

umask a=rwx

ERRLOG=/tmp/client.errlog
LOG=/tmp/client.log

#Login Settings
FTPLOGIN=/home/client/.login.cfg

REMOTEDIR=DATA/MARKET/*.txt

LOCALDIR=/ftp/client/data/
FILE=`ls -1 *.txt 2> /dev/null`

# Connect and collect
       /usr/local/bin/ncftpget -P 22 -DD -f $FTPLOGIN $LOCALDIR $REMOTEDIR

The file: /home/client/.login.cfg contains:

The FTP application "/usr/local/bin/ncftpget" supports port 22 but when trying to connect to the client server it cannot connect.
I think the SSH encryption and protocol cannot be read as it is a normal FTP application.

I need to use something like SFTP to do the same as the above script.
Connect
Change directory and pull data
Remove data from client server
Close connection

Thanks

Don't know about ncftpget - it has to be absolutely compatible to sshd/sftp in order to make it work.
Also using sftp is not about using ftp-scripts like here-scripts to use user and password etc. It is about exchanging public keys to make it work.

Recommendation is to exchange public keys (created without passphrase) in the direction you need them and set up a small script that does scp instead of sftp, if that is hopefully an option for you. Syntax is similar to rcp.
There are several threads here in the forum and on the web about it how to set it up.