A way to distinguish errors?

Advertisement

TVB_FSU
Guest

A way to distinguish errors?

Hello! First of all, let me say I "inherited" this task, and it's not exactly more area of expertise, so if I ask stupid questions, please bear with me! I searched documentation and FAQs and can't find the answer to this...

We have a database that exports two .csv files that we upload to another area of campus. There are times when there are no files to export/upload.

At the end of the script is:

echo Success!
"C:\Program Files\WinSCP\email_success.vbs"
goto end

:error
echo Error!
"C:\Program Files\WinSCP\email_error.vbs"

My question is this: If there is no file to send, can it not be considered an error? The script runs every 30 minutes with scheduler, so there are many times there just isn't anything to upload.

Thanks in advance for your assistance!

Trish

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: A way to distinguish errors?

What about not running the script if the files do not exist?
_________________
Martin Prikryl

Reply with quote

TVB_FSU
Guest

Re: A way to distinguish errors?

martin wrote:

What about not running the script if the files do not exist?

Thanks Prikryl ... Can you point me to where I can learn how to write that into the script. I have experience with php and database scripting with if/else, but not this type.

Thanks again for the response!

Trish

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: A way to distinguish errors?

Not in script, in your batch file that runs WinSCP to run the script.

Something like:

if not exist yourfile.cvs exit

winscp.exe /script=script.txt

Last edited by martin on 2008-10-02; edited 2 times in total

Reply with quote

Advertisement

You can post new topics in this forum