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

mcasper

Re: Transfer files from remote folder with "mv" command i can't overwrite

Thank you very much, I voted for it.

For now, I don't have the necessary skills to use the .NET version. :-(

Thank you for your effort.
martin

Re: Transfer files from remote folder with "mv" command i can't overwrite

It's not possible.

I have added this request to the tracker:
Issue 2401 – Allow mv command to overwrite target files
You can vote for it there.

Meanwhile, you can:

  • Delete the files from the target folder, if you know their names, or if you can delete all files.
  • Use WinSCP .NET assembly (instead of scripting) to iterate sources files and check their existence in the target folder, deleting and moving as needed.
    https://winscp.net/eng/docs/library
mcasper

Transfer files from remote folder with "mv" command I can't overwrite

Hi,
I am using a bat file to call winscp.exe using /script below.
My script contains the command mv that move files from one remote folder (/BOLLE/temp_000001/) to another remote folder (/BOLLE/) on the same server.

When mv command transfer the files from one to second remote folder and in the destination file/s already exist in which case the equiv source files are not moved.

Is there any way when using the mv command, or other command, to force the target files to always be overwritten so the source files are always "moved"?

V6.5.3 portable SO Windows
option batch continue                                                
option confirm off                                             
option reconnecttime 60                                         
option failonnomatch off                                       
open ftp://xxxxxxx                             
lcd \xxxxxx\txx                                           
cd /IN                                             
rmdir temp_000001                                           
mkdir temp_000001                                           
cd temp_000001                                               
synchronize remote -filemask="*.ZIP; *.INI|*/" -transfer=binary -delete=off         
cd /BOLLE                                             
mv /BOLLE/temp_000001/*.* /BOLLE/         
exit

FTP folder tree details:
/IN

/BOLLE
/BOLLE/temp_000001

Thank you, regards