Topic "How to delete files after copying"

Author Message
bkand

Guest


Hi,
I have the following code to copy files from the remotes server onto my local server. Can someone please help me or advice me as how to delete the files on the remote server once i copy them?
Code:

option batch on
option confirm off
open sftp://<username>:<password>@server -hostkey="ssh-dss xxxxxxxxxxxxxxxx"
cd .
option transfer binary
get -preservetime *.txt F:\FTPShare\ftp\
 close
exit

Please need help.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Use -delete switch of get command:
https://winscp.net/eng/docs/scriptcommand_get

For alternative see:
https://winscp.net/eng/docs/faq_delete_synchronized_files
_________________
Martin Prikryl
sgarciav

Guest


I noticed that in the example the GET statement uses a wildcard. Is this allowed with GET in general or is this a WinSCP specific feature? Thanks, Salvador
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What is "GET in general"?
_________________
Martin Prikryl
sgarcia

Guest


"GET in general" - What I am asking is whether the use of wildcards is a standard feature of the GET command or whether it is specific to WinSCP. Thanks, Salvador
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The get command is a specific command of WinSCP. If you are using a different tool, that also has a get command, you should seek a help with their support. There is no global specification of "get" commands, as far as I know.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License