delete files on remote server

Advertisement

Guest

delete files on remote server

Hello I have written the following script to get files from the remote server and copy them to our local server, this is working fine. Now I want to also get the files on the remote server after they have been copied, but my get - delete isn't working, could someone help me modify my script please.
# Connect
open sftp:...
 
# Change remote directory
cd /SA223/PHI/RWB
 
# Download file to the local directory A:\Shares\Ochin-ReportingWorkBench
get * A:\Shares\Ochin-ReportingWorkBench\
 
# Delete Remote Files (here is the problem)
get -delete * .\
 
# Disconnect
close
 
# Exit WinSCP
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
35,438
Location:
Prague, Czechia

Re: delete files on remote server

I'm not sure what you mean by "get the files on the remote server". Did you mean "delete"?
You might be looking for this:
get -delete * A:\Shares\Ochin-ReportingWorkBench\
(i.e. add the -delete to your first get command)

Reply with quote

Advertisement

You can post new topics in this forum