Empty file downloaded
Hi there, I'm having an issue with downloading text files from an ftp server. Multiple times a day I upload files to a certain folder called outbound. From this folder a different user runs a script (see below) that downloads all these files with 30 min. intervals. After it has downloaded all files, it moves the files to a folder outbound/archive on the ftp. The script runs on Windows 2008 Server with WinSCP version 5.7.2 build 5316.
Command line:
Script:
This all seemed to work great, except for the last two weeks in which we encountered twice the issue that a file was downloaded as a 0 bytes file. However, looking back at these files in the outbound/archive folder they did contain data.
So now the question remains how this is possible. At first I thought that maybe the script tried to download the file while it was still being written. However, another file that was uploaded after the 'empty' file, was downloaded correctly. So that scenario does not seem very likely.
I've attached the only logs that I could retrieve, not sure whether there should be more extensive ones.
Does anybody else have an idea for a possible reason? Should I try a more extensive script to only download the file when it is not empty and also only move the file in that case?
I hope you can help!
Command line:
"PathToWinSCP\winscp.exe" /script=PathToScript\Script.txt /xmllog=PathToLog\LogFTP.xml
option batch abort option confirm off open ftp://<ftpurl> cd /outbound option transfer binary get foo*.txt e:\downloads\ mv foo*.txt /outbound/archive/ close exit
So now the question remains how this is possible. At first I thought that maybe the script tried to download the file while it was still being written. However, another file that was uploaded after the 'empty' file, was downloaded correctly. So that scenario does not seem very likely.
I've attached the only logs that I could retrieve, not sure whether there should be more extensive ones.
Does anybody else have an idea for a possible reason? Should I try a more extensive script to only download the file when it is not empty and also only move the file in that case?
I hope you can help!