Topic "Scripting : disabling resume option"

Author Message
marcvds

Guest


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 Very Happy

Marc
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl
Marcvds

Guest


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

Thanks for your help. Very Happy
Nonnb

Guest


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. Very Happy
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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
vt

Guest


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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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
vt

Guest


I'm back. I read the documentation and it's a bit unclear to me what is needed in the ini.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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
Ben4130

Guest


prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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:
http://winscp.net/eng/docs/faq_script_ini
Ben4130

Guest


prikryl 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:
http://winscp.net/eng/docs/faq_script_ini


Thanks Smile
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License