Page 1 of 1

FTP issue/ Bug?

Posted: Sat 13 Aug 2022 6:17 pm
by dale
I'm running version 3.19.3. I use FTP to upload the data to my website. For my website FTP does allow rename, but NOT if the target file exists. (In general this is true, I believe.) From looking at FTP logs in CumulusMX I observe:

1) if I tell CumulusMX to use FTP rename (without setting the delete before uploading flag), it always fails because CumulusMX attempts to rename without first deleting the target which exists.
2) If I tell CumulusMX to delete the target file before uploading, the file is deleted, then uploaded (and if use rename is enabled) it is renamed properly. If rename is NOT enabled, then the file is uploaded directly to the target filename.

I think that the interaction of these two flags is, perhaps, incorrect. It seems to me that if only the rename flag is enabled, the file should be uploaded to a temporary file, then the actual file should be deleted, then the rename should take place. I think this is the fastest way to safely replace the file. However, this is not possible currently. Instead CumulusMX deletes the target file (if that flag is set) and then uploads the temporary file and then renames the temporary file. This causes a longer time when the file is either missing or is only partially populated while the upload is taking place.

Am I missing something? Is there any FTP server that allows a rename when the target file already exists?

Re: FTP issue/ Bug?

Posted: Sun 14 Aug 2022 8:50 am
by mcrossley
Am I missing something? Is there any FTP server that allows a rename when the target file already exists?
My personal experience is that I have yet to have an FTP server that doesn't!

Originally I think these flags were seen as exclusive, you used one or the other.
However if they are both switched on then yes, it would be better to upload to a tmp file, delete the destination, then rename.

But only if only rename is enabled, then I believe the current process works for the majority of servers and incurs the smallest period where the data is unavailable.

Re: FTP issue/ Bug?

Posted: Sun 14 Aug 2022 4:43 pm
by dale
If you could modify the behavior when both a switch on, that would be great! Thanks.