Can't disable resume transfer

Advertisement

brighty
Guest

Can't disable resume transfer

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Can't disable resume transfer

Use -resumesupport switch.
See https://winscp.net/eng/docs/resume#switch

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.

Reply with quote

Guest

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
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.

Reply with quote

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.

Reply with quote

Advertisement

MikeLindsey
Guest

-resumesupport=off in script

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!

Reply with quote

Advertisement

You can post new topics in this forum