I have the below script to transfer files to remote server(Unix) and then delete the files in the local directory. But once in a day we are seeing the below error.
"Script: System Error. Code: 2.
The system cannot find the file specified"
1 out of 100 files was not copied to the remote directory and is also being deleted from the local folder. can someone please help me to know if there is a way to NOT delete the file if it was not transferred to the remote server.
we are using WinSCP Version 5.1.7(Build 3446)
Here is the batch script that runs every one minute.
start winscp /console /script="C:\CDI\SFTP.txt" /log=SFTP.Log
option batch abort
option confirm off
open sftp://user:password@HostName -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:x:xx:xx:xx"
option transfer binary
put -delete File_20141214230801099.txt
chmod 777 File_20141214230801099.txt