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

Advertisement

mcasper
Joined:
Posts:
2

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,398
Location:
Prague, Czechia

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

Reply with quote

mcasper
Joined:
Posts:
2

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.

Reply with quote

Advertisement

You can post new topics in this forum