Topic "A way to distinguish errors?"

Author Message
TVB_FSU

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
What about not running the script if the files do not exist?
_________________
Martin Prikryl
TVB_FSU

Guest


prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
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
TVB_FSU

Guest


Awesome ... Thanks so much!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License