Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

lyf wrote:

I think when WinSCP finds there are no files to upload, it sees this as an error but it is actually perfectly fine since not everytime there will be files to send. So how are we going to differentiate this error from the real problems?

This is not true.
Your batch file is simply wrong, as I have suggested in my previous post.
lyf

martin wrote:

Your batch file misses goto end command after move command, so you get the email even on success.


I think when WinSCP finds there are no files to upload, it sees this as an error but it is actually perfectly fine since not everytime there will be files to send. So how are we going to differentiate this error from the real problems?

cheers
lyf
martin

Your batch file misses goto end command after move command, so you get the email even on success.
torentine

I just wish that I wouldnt get a failed email after the job tries to run and there are no files in the directory.
Guest

oh ok after the script runs it calls on a bat file with the following code:

winscp.com /script=MoveLabResults.txt
if errorlevel 1 goto error

echo Upload succeeded, moving local files
move C:\cssw\hl7\emd\Results\*.* c:\backup\

:error
echo Error!
bmail.exe -s 192.168.16.10 -t user@example.com -f Results@example.com -b "FTP File Transfer Failed To SVMH" -a "PCM LabLab Results Transfer Failure"


:end
martin

Re: Newbe email notification question

OK, but what about the code that sends the email?
torentine

Newbe email notification question

First of all congratulation on a great product.

Now moving on, I have a folder on my network on which users store lab results. I created a scheduled task which call on WINSCP to automatically upload any new files to remote FTP server and then it moves those files to a different directoy on the local server. All this is working just fine.

The problem is that I also configured email notification for when the job fails. The email portion works a little to well. The problem is that when there are no files to be transfered I get an email with an error notification.

This is what I have as a script which get called on by a batch file.

option batch on
option confirm off
open labresults
put *.*
exit

Please Help