Ok I'll try to explain it . But it is quite complex. I have two ERP´s.
- ERP 1 creates this csv file. As long as the file exists on the local server, this file is always extended by a new line.
- ERP 1 pushes the csv file to an FTP server. The file always has the same name.
- With ERP 2 I have the problem that this system can only fetch one file per hour. Therefore the file from ERP 1 must always have the same name.
Theoretically, ERP 1 tries to upload the file every 10 minutes. However, this can only happen if ERP 2 has actually retrieved this file. However, this can only happen every hour.
Both methods described by you would always overwrite the file on the FTP server. Why -> At the moment when there is no file on the FTP server, ERP 1 pushes the new file to the FTP.
So far ok.
10 minutes later, a new csv file has been created on the local server by ERP 1. This is therefore newer than the file on the FTP server.
WinSCP would now go and replace the file on the FTP server with the file from the local server.
So I am really looking for a command function that really checks whether the file already exists on the server before the upload.
If the file is still on the FTP do nothing.
If the file is no longer on the FTP, upload the new file.
Thx for your Help