Topic "Can't disable resume transfer"

Author Message
brighty

Guest


Hi, I'm using v4.3.5 on a server to SFTP some PDFs on a daily basis. The transfer job is automated using a .bat file which calls:

winscp.com /script="D:\Program Files\WinSCP\GIS Scripts\***.txt"

The script looks like (comments removed):
option batch abort
option confirm off
open user:password@server -timeout=45
cd /folder
option transfer binary
put -delete E:\...\*.PDF
close
exit

Pretty standard stuff. I'd like to disable the resume transfer option. It's causing us an issue as the server we SFTP the PDFs to has a polling function which takes anything that arrives and passes it on. If a file transfer is in process or there's a connection issue, then there's a .filepart file in there that gets picked up and moved on to the destination. Sometimes the transfer resumes successfully and the destination will have both a .pdf.filepart and a .pdf. Sometimes it does not and the destination will have a .filepart and a .pdf of zero bytes.

I can untick the Resume Transfer option in the Preferences in the client app on the server and Disable the Endurance. But we're still getting fileparts. Is this because we're running the transfer from a script and that uses default options and not options changed in the client app? Any way that I can disable this option?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
Please read FAQ:
https://winscp.net/eng/docs/faq_script_ini

Though not sure if disabling resume support really helps. It probably won't prevent the polling function from picking up a partially transferred file. Consider uploading the file to an intermediate directory. Once uploaded, move it using mv command to the destination directory.
_________________
Martin Prikryl
Guest




Thanks for the response. I'll try storing the config in an ini file and using it from the script. Sounds like that would be a good idea anyway, as easier to progress changes from non-live environments to live.

Sending to a temp folder sounds like the winner in this scenario.

Although ... if the 'transfer resume' function is what creates the filepart files and that function is successfully disabled, then what happens during the transfer? If a file is halfway transferred, then what is actually in the destination folder? Is it half a file of the same name e.g. File1.pdf? If the polling tool took this instead of the .filepart, then this would be worse.

Or is it that .fileparts are created for all transfers and the transfer resume function simply allows broken transfers to be resumed? In which case, I'll go directly to a temp folder solution.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
Anonymous wrote:
Although ... if the 'transfer resume' function is what creates the filepart files and that function is successfully disabled, then what happens during the transfer? If a file is halfway transferred, then what is actually in the destination folder? Is it half a file of the same name e.g. File1.pdf? If the polling tool took this instead of the .filepart, then this would be worse.

Yes, half file of the same name. I'd suggest you to use the temp folder solution. Or alternatively, keep the current way with .filepart files and modify your polling function to ignore these files.
_________________
Martin Prikryl
brighty

Guest


Hi, just a quick update to say that this issue seems resolved. Apparently, the pollers at the receiving end could (would) not be changed to ignore fileparts. They're pretty confident that they can recognise files in the process of being transferred so won't pick up partial files. So their steer was definitely to disable the resume transfer option causing the fileparts.

It did seem that changing the default settings to do this was not being reflected in the actual transfer as run from an automated script.

So I amended the settings and then exported them to an ini, and then referred to that ini when calling winscp.com with a script file. Since making this change, the issue has not re-occurred.

Thanks for the help.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
Thanks for your feedback.

Actually I do not know why I pointer you to INI file workaround. You can simply disable transfer to temporary file name using -resumesupport=off switch.
_________________
Martin Prikryl
MikeLindsey

Guest


Where do I put the -resumesupport=off

I run a batch file that contains this:

"D:\Program Files\WinSCP\winscp.exe" /console /script="D:\Program Files\xxx\OCNFTP.scp" /log="D:\Program Files\xxx\winscp.xml"


Here's the scp file:

option batch abort
option confirm off
open sftp://user:pass@ftp.xxx.com
option transfer binary
put "D:\Program Files\xxx\FtpFiles\*.zip"
close
exit

Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
MikeLindsey wrote:
Where do I put the -resumesupport=off

Like:
put -resumesupport=off "D:\Program Files\xxx\FtpFiles\*.zip"
See https://winscp.net/eng/docs/scriptcommand_put
_________________
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