Question

I have a question regarding copying multiple files from one directory to another remote directory in SSIS. I'm using WinSCP, below is my script file.

option batch on
option confirm off
open username:password@ipaddress -timeout=1000 -hostkey="ssh-rsa 39439:xx:xx:xx:xx:xx"
option transfer binary
put c:\temp\*.xlsx
close
exit

It copies the first file successfully, I have couple more to be copied. Is this the correct way to copy multiple files?

Was it helpful?

Solution

Yes, this is a correct way to upload multiple files.

It does not work, because your server does not support preserving file timestamp.

You can make WinSCP not try to preserve the timestamp by adding the -nopreservetime switch to the put command.

put -nopreservetime c:\temp\*.xlsx

For more details see the documentation for the error message Upload of file .. was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on 'Ignore permission errors' option..

OTHER TIPS

If the file is locked (in use), change "batch" to "continue", to skip errors.

option batch continue
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top