Post a reply

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)


Topic review


Re: Overwrite

Please attach a full log file showing the problem.

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.



I have my WinSCP to transfer files from 1 SFTP site to another every morning, but for some reason i cant get it to overwrite my local files on download or the second SFTP site on upload. am i missing something?

Code inclosed below: (File Names and Servers changed to generics)

# Automatically abort script on errors

option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
open Server1
# Force binary mode transfer
option transfer binary
# Download file to the local directory c:\
get file1.txt c:\file\
get file2.txt c:\file\
get file3.txt c:\file\
get file4.txt c:\file\
get file5.txt c:\file\
get file6.txt c:\file\
get file7.txt c:\file\
get file8.txt c:\file\
get file9.txt c:\file\
# Disconnect
# Connect to a different server
open server2
# Upload the file to current working directory
put c:\file\file1.txt
put c:\file\file2.txt
put c:\file\file3.txt
put c:\file\file4.txt
put c:\file\file5.txt
put c:\file\file6.txt
put c:\file\file7.txt
put c:\file\file8.txt
put c:\file\file9.txt
# Disconnect
# Exit WinSCP