I have synchronized local and remote file using WinScp and scheduled with windows task scheduler That execute the script once in a day and download the file if the remote file is new or updated, otherwise do nothing.
Here is the script code
option include data.csv synchronize local d:\ /home/dir
But now What I want to do is echo the message on command prompt if the remote file is new and update and downloaded in the local directory.
The Idea behind this is the user don't have to check the file daily to see if there is new updates.
So they will be notified through this message on command prompt.
What do I add in this script to check that the newer version of file has been downloaded and echo some message otherwise do nothing?
Now I am here-
I created a batch file which contains the code like this:-
winscp.com /console /script=dwn_script.txt @echo off if errorlevel 1 goto error echo The new version of data.csv file has been downloaded. Please check your local disk :error
errorlevel is always set to
0 in both cases when winscp says "Nothing to synchronize" and when winscp download the newer version of file.
Can anyone please clarify what variable differentiate the status "Nothing to synchronize" and successful download of file?
If I get that difference I can put it into
if condition and can show the message to user that the new file has been downloaded.