Scripting : disabling resume option

Advertisement

marcvds
Guest

Scripting : disabling resume option

Hi,

I use WinSCP to transfer files to a protected SFTP server using the following script:

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open user:password@example.com
# Connect
open xxxxxxxx:yyyyyyyy@xxx.xxx.xxx.xxx:xxxx-hostkey="ssh-dss 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory
# cd /tmp/SFTP
# Force binary mode transfer
option transfer binary
# Upload the file to current working directory
put c:\Files\*.*
# Disconnect
close
# Exit WinSCP
exit


I receive the following error in the log file:

* 2009-10-20 08:00:02.206 Error code: 4
* 2009-10-20 08:00:02.206 Error message from server (en): Failure
* 2009-10-20 08:00:02.206 Request code: 18
. 2009-10-20 08:00:02.206 Asking user:
. 2009-10-20 08:00:02.206 Transfer was succesfully finished, but temporary transfer file 'CAMDEF_20091019.csv.filepart' could not be renamed to target file name 'CAMDEF_20091019.csv'. If the problem persists, you may try to turn off transfer resume support. ("General failure (server should provide error description).

When using the WinSCP GUI, I overcome the problem by disabling the Enable transfer resume/transfer to temporary filename for in Endurance

My question is : how can I disable the resume/temporary filename option in scripts when using scripts?

My config is:
WinSCP 4.1.8 (Build 415)
Windows XP Pro SP3

Thanks for your help and congratulations for such a useful piece of software :D

Marc

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Scripting : disabling resume option

Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl

Reply with quote

Nonnb
Guest

Re : disabling resume from Script

Hi Mark / prikryl

We have exactly the same problem - could you show exactly what you did to disable transfer to temporary file?

? Is this INI file used from the GUI (and configured with the Enable transfer resume/transfer to temporary file set to off

Thanks and Regards

Stuart

***

Marcvds wrote:

Using open <session> and INI file solved the problem.

Thanks for your help. :D

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Re : disabling resume from Script

Nonnb wrote:

? Is this INI file used from the GUI (and configured with the Enable transfer resume/transfer to temporary file set to off
Yes.
_________________
Martin Prikryl

Reply with quote

vt
Guest

Turn off transfer resume support confusion

So I looked at the ini file and I'm still unsure how to turn off the temporary file setting. Is this a setting that's done on the GUI and then we can export the setting to an ini? If so, where is this done on the GUI? I looked in preferences under Transfer but don't see a switch?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Turn off transfer resume support confusion

vt wrote:

If so, where is this done on the GUI? I looked in preferences under Transfer but don't see a switch?
Please read documentation. If that does not help, come back.
_________________
Martin Prikryl

Reply with quote

vt
Guest

Turn off transfer resume support

I'm back. I read the documentation and it's a bit unclear to me what is needed in the ini.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Turn off transfer resume support

vt wrote:

I'm back. I read the documentation and it's a bit unclear to me what is needed in the ini.
The format of INI file is not documented. If you want to find out what option is changed, just keep the ini file before making the change and compare against the one after the change.
_________________
Martin Prikryl

Reply with quote

Ben4130
Guest

Re: Turn off transfer resume support

martin wrote:

vt wrote:

I'm back. I read the documentation and it's a bit unclear to me what is needed in the ini.
The format of INI file is not documented. If you want to find out what option is changed, just keep the ini file before making the change and compare against the one after the change.

I have tried selecting "Disable" in the "Enable transfer resume/transfer to temporary file" frame and then compared the before/after ini files but nothing has changed (the file's "date modified" value is updated but the text inside the file has not changed).

I have also tried changing the file size threshold to a larger value but this also doesn't seem to leave any changes.

I need to be able to disable the transfer resume without using the GUI.
Is there another way to do this?

Thanks

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Turn off transfer resume support

Ben4130 wrote:

I have tried selecting "Disable" in the "Enable transfer resume/transfer to temporary file" frame and then compared the before/after ini files but nothing has changed (the file's "date modified" value is updated but the text inside the file has not changed).
It definitely works.
But anyway, I have added an example to the FAQ:
https://winscp.net/eng/docs/faq_script_ini

Reply with quote

Ben4130
Guest

Re: Turn off transfer resume support

martin wrote:

Ben4130 wrote:

I have tried selecting "Disable" in the "Enable transfer resume/transfer to temporary file" frame and then compared the before/after ini files but nothing has changed (the file's "date modified" value is updated but the text inside the file has not changed).
It definitely works.
But anyway, I have added an example to the FAQ:
https://winscp.net/eng/docs/faq_script_ini

Thanks :)
Don't know how I missed that line in the config in the first place.
BTW there is a small typo in the comments of the newly added part in the FAQ (it says ResumeSupport value should be 3 to disable but it should be 2).

Thanks again.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Turn off transfer resume support

Ben4130 wrote:

BTW there is a small typo in the comments of the newly added part in the FAQ (it says ResumeSupport value should be 3 to disable but it should be 2).
Thanks. Fixed.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum