SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
File Check not working, Error Email firing unexpectedly

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
File Check not working, Error Email firing unexpectedly
Author Message
davisbm49



Joined: 19 Aug 2009
Posts: 4
Country: United States

Post File Check not working, Error Email firing unexpectedly Reply with quote
Hello,

I am having a problem with a job regarding file checking.

Summary:
My job runs a .cmd file which runs through and FTP's and moves various files. This works fine. However, I am trying to come behind it after the "Run" command and check to make sure those files are there. Even though the files are there the jobs still fires an error and sends an Email message when it should. The strange thing is this only happens when the job is scheduled. When I run the job manually I don't get an an error email which is the expected outcome.

I've seen another post relating to mapped drives. Could that be the problem? Maybe I should just use UNC paths but I have also seen "NET USE" although I'm not sure what that is?
http://www.softtreetech.com/support/phpBB2/viewtopic.php?t=22934


Let me know if you need more information. Thanks ahead of time for your helps

Code:
*******************************************************************************************

//Declares Previous Business Date
dim dtePrevBusDay, string, @DL"mmddyy"

//Declares Novell FTP info
dim strNovellServer, string, "servername"
dim strNovellID, string, "account"
dim strNovellPass, string, "password"
dim strNovellDir, string, "//Directory/foldera/folderb"

//Used to created Full path of where file will reside on Novell
dim strNovellFileDate, string

//Used to create the file names with previous business date
dim FileNameDate, string

//Boolean values that track whether files on Novell are available
dim DoesExistTokenDate, boolean, "TRUE"


dim strMsg, string
OnErrorGoTo Err_Handler

//Run FTP .cmd File which perfroms the following step
// 1.) Grabs all files
// 2.) Moves them to Addvantage Server
// 3.) Then FTP them to the Novell Drive

dim process, number
Run("N:\AddVantage\Script\DOSbats\ReliusFTP.cmd", "N:\AddVantage\Script\DOSbats", process)


//Check File 1
Concat(dtePrevBusDay, ".txt", FileNameDate)
Concat(strNovellDir, FileNameDate, strNovellFileDate )
FTPFileExists ( strNovellServer, strNovellID, strNovellPass, strNovellFileDate, DoesExistTokenDate)
If (DoesExistTokenDate, FILEEXISTSDATE, NOFILEEXISTSDATE)
FILEEXISTSDATE:
//File is there
GOTO END
NOFILEEXISTSDATE:
Concat("File Not Found:", FileNameDate, strMsg)
GOTO Err_Handler
END:
EXIT


Err_Handler:
GetLastError strMsg
Concat "Error message reported by the 24X7 System: ", strMsg, strMsg
LogAddMessageEx "ERROR", 0, "RELIUS_MOVE_NOVELL", strMsg
MailSend "24x7", "", "username@abc.com", "RELIUS_MOVE_NOVELL - ERROR", strMsg
Exit
*******************************************************************************************
Fri Sep 25, 2009 8:49 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
Hi,

You should be using RunAndWait instead of Run. Run only kicks the process and doesn't wait for the process to complete.
Fri Sep 25, 2009 8:58 am View user's profile Send private message
davisbm49



Joined: 19 Aug 2009
Posts: 4
Country: United States

Post Reply with quote
Wow...that was easy. I'll try that and let you know.

Thanks!
Fri Sep 25, 2009 9:03 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.