Topic "How can I prevent overwriting existing files?"

Author Message
Larsey
[View user's profile]

Joined: 2014-01-19
Posts: 1
Location: Norway
I've got this script:

Code:
# Automatically abort script on errors
option batch abort

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect
open ftp://root:filebox@10.0.0.19 -hostkey="xxx"

# Change remote directory
cd /media/hdd/docs

# Force binary mode transfer
option transfer binary

# Download file to the local directory
get *.txt H:\ftptest\

# Disconnect
close

# Exit WinSCP
exit


And what it does it copies everything in that directory each time. Is there a way I can make it skip the file if it already exists in the target directory?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please read FAQ:
https://winscp.net/eng/docs/faq_script_modified_files

If that does not help, come back.
_________________
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