sftp copy file then move file moved but not copied
Hi,
Below is the script we use to copy files it then moves the files to another directory for a clients ERP software to upload
the script works with the only issue being, Files are copied, then I think a new file is added just before the move command takes place. This file is then included in the move process. Example in the attached WinSCP log extract is file
It is not listed as being copied but listed as being moved, so the client does not receive the order.
Below is the script we use to copy files it then moves the files to another directory for a clients ERP software to upload
@echo off "C:\Program Files (x86)\WinSCP\WinSCP.com" ^ /log="C:\temp\WinSCP.log" /ini=nul ^ /command ^ "open sftp://SFTP SERVER DETAILS ARE HERE" "get -filemask=|processed/; /production/fermexdistributors/fresho_orders/*.* c:\Capital\Capshell\CAPITAL\FRESHO_IN\Orders\*.*" ^ "mv /production/fermexdistributors/fresho_orders/*.xml /production/fermexdistributors/fresho_orders/processed/*.xml" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) exit /b %WINSCP_RESULT%
0008599523_new_order_fermex_distributors_2023-11-23--10-56-25.xml
.
It is not listed as being copied but listed as being moved, so the client does not receive the order.