Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Larsey

How can I prevent overwriting existing files?

I've got this script:

# 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?