SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
jobs not running correctly

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
jobs not running correctly
Author Message
ahill



Joined: 02 Mar 2005
Posts: 17

Post jobs not running correctly Reply with quote

Hello,

My jobs aren't running correctly-
I think this is a problem with how to run the scripts or the environment, etc

I have a few scripts below is one of them, When I run them in test or normal they run fine
window pops up, follows the commands, closes window

However it never does all of this in schedule
I am logged into a server via RDP
24x7 is runnning normal (not as a NT service) not sure which is best

My job is set to run at 6:00 in the morn- (they put the file there at 5:00) and I have woken up and checked that the file is there
I receive the email stating the job finished
When I look at the RDP session when I get in in the morn
There is the open command window open
(Its path matched that of the path statement in the run command)
The file has not been downloaded, and therefore no copy

Why is this happening?
Do I need to run 24x7 as an NT service?
Why aren't my jobs actually running?
any ideas, suggestions

thanxs
Anthony

dim (return, number)

// launch cmd window
Run( "cmd", "R:\Vendors\GoldmanSacs", Return )
Wait( 2 )

//log in
SendKeys( "ftp XXX.com{ENTER}" )
Wait( 4 )
SendKeys( "LOGIN{ENTER}" )
Wait( 4 )
SendKeys( "PSWD{ENTER}" )
Wait( 4 )
//get files
SendKeys( "cd outgoing{ENTER}" )
Wait( 4 )
SendKeys( "get posn{shift}Custody.txt.pgp{ENTER}" )
Wait( 10 )

// close ftp session
SendKeys( "bye{ENTER}" )
Wait( 2 )

// decrypt file
SendKeys( "c{shift};{ENTER}" )
Wait( 1 )
SendKeys( "cd ../../vpgp{ENTER}" )
Wait( 1 )
SendKeys( "gs{shift}-security.exe {shift}(DECRYPTION) c{shift};\vpgp\ R{shift};\Vendors\GoldmanSacs\posn{shift}Custody.txt.pgp R{shift};\Vendors\GoldmanSacs\posn{shift}Custody{shift}(NS).txt NAME COMMNET {shift}'PASSPHRASE{shift}'{ENTER}" )
wait ( 5 )
//Copy file
FileCopy( "R:\Vendors\GoldmanSacs\posnCustodyNS.txt", "R:\Vendors\GoldmanSacs\posnCustodySDS.txt" )
Wait( 5 )
SendKeys( "exit{enter}")

Wed Mar 02, 2005 7:27 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7974

Post Re: jobs not running correctly Reply with quote

You cannot use SendKeys with the service or when the screen is locked or screensaver is active, just because there is no user desktop available at that time and so you don't have a target window at that time to send your keystrokes to.

One solution is to force the user desktop by automatically logging in to the system and unlocking the screen. Get Logo.exe utility from the 24x7 Tips and Script archive. You can use to unlock the desktop.

Another solution, which I strongly recommend as the best choice, is to avoid using SendKeys and other graphics-related things for critical business processing all together. SendKeys should be used only as a last resort for automating "bad" graphical applications that don't support any business automation (or better find a replacement for such bad application).

In this particular case you should be able to automate the processing using more reliable methods. For example, why not to use FTP commands in 24x7 to do the FTP instead of controlling the command line FTP with sent key? If for whatever reason you prefer the command line FTP you can still run it automated using an simple FTP script saved as file. The start command would be then like below

FTP -n -smyscript.ftp

The constants of myscript.ftp file is below
OPEN servername
USR myname
PWD my password
CD ...some path
GET .... some file
etc...

Similarly you can use command line parameters with pgp and other utilities to avoid interactive processing.

This way you can run the whole thing in any mode as an interactive job, standalone scheduler, service, and so on...

: Hello,

: My jobs aren't running correctly-
: I think this is a problem with how to run the scripts or the environment, etc

: I have a few scripts below is one of them, When I run them in test or normal
: they run fine
: window pops up, follows the commands, closes window

: However it never does all of this in schedule
: I am logged into a server via RDP
: 24x7 is runnning normal (not as a NT service) not sure which is best

: My job is set to run at 6:00 in the morn- (they put the file there at 5:00)
: and I have woken up and checked that the file is there
: I receive the email stating the job finished
: When I look at the RDP session when I get in in the morn
: There is the open command window open
: (Its path matched that of the path statement in the run command)
: The file has not been downloaded, and therefore no copy

: Why is this happening?
: Do I need to run 24x7 as an NT service?
: Why aren't my jobs actually running?
: any ideas, suggestions

: thanxs
: Anthony

: dim (return, number)

: // launch cmd window
: Run( "cmd", "R:\Vendors\GoldmanSacs", Return )
: Wait( 2 )

: //log in
: SendKeys( "ftp XXX.com{ENTER}" )
: Wait( 4 )
: SendKeys( "LOGIN{ENTER}" )
: Wait( 4 )
: SendKeys( "PSWD{ENTER}" )
: Wait( 4 )
: //get files
: SendKeys( "cd outgoing{ENTER}" )
: Wait( 4 )
: SendKeys( "get posn{shift}Custody.txt.pgp{ENTER}" )
: Wait( 10 )

: // close ftp session
: SendKeys( "bye{ENTER}" )
: Wait( 2 )

: // decrypt file
: SendKeys( "c{shift};{ENTER}" )
: Wait( 1 )
: SendKeys( "cd ../../vpgp{ENTER}" )
: Wait( 1 )
: SendKeys( "gs{shift}-security.exe {shift}(DECRYPTION) c{shift};\vpgp\
: R{shift};\Vendors\GoldmanSacs\posn{shift}Custody.txt.pgp
: R{shift};\Vendors\GoldmanSacs\posn{shift}Custody{shift}(NS).txt NAME
: COMMNET {shift}'PASSPHRASE{shift}'{ENTER}" )
: wait ( 5 )
: //Copy file
: FileCopy( "R:\Vendors\GoldmanSacs\posnCustodyNS.txt",
: "R:\Vendors\GoldmanSacs\posnCustodySDS.txt" )
: Wait( 5 )
: SendKeys( "exit{enter}")

Wed Mar 02, 2005 7:52 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7974

Post Re: jobs not running correctly Reply with quote

Corrected message follows.

You cannot use SendKeys with the service or when the screen is locked or screensaver is active, just because there is no user desktop available at that time and so you don't have a target window at that time to send your keystrokes to.

One solution is to force the user desktop by automatically logging in to the system and unlocking the screen. Get Logon.exe utility from the 24x7 Tips and Script archive. You can use it to automatically unlock the desktop before you run the main part of the job.

Another solution, which I strongly recommend as the best choice, is to avoid using SendKeys and other graphics-related things for critical business processing all together. SendKeys should be used only as a last resort for automating "bad" graphical application that doesn't support any business automation (or better find a replacement for such bad application).

In this particular case you should be able to automate the processing using more reliable methods. For example, why don’t you use FTP commands in 24x7 to do the FTP instead of controlling the command line FTP window with sent keys? If for whatever reason you prefer the command line FTP you can still run it automated using simple FTP scripts saved as files. The start command would be then like below

FTP -n -smyscript.ftp

Sample contents of myscript.ftp file is below
OPEN servername
USR myname
PWD my password
CD ...some path
GET .... some file
etc...

Similarly you can use command line parameters with pgp and other utilities to avoid interactive processing.

This way you can get the whole thing running fine in any mode, as an interactive job, standalone scheduler, service, and so on...

: You cannot use SendKeys with the service or when the screen is locked or
: screensaver is active, just because there is no user desktop available at
: that time and so you don't have a target window at that time to send your
: keystrokes to.

: One solution is to force the user desktop by automatically logging in to the
: system and unlocking the screen. Get Logo.exe utility from the 24x7 Tips
: and Script archive. You can use to unlock the desktop.

: Another solution, which I strongly recommend as the best choice, is to avoid
: using SendKeys and other graphics-related things for critical business
: processing all together. SendKeys should be used only as a last resort for
: automating "bad" graphical applications that don't support any
: business automation (or better find a replacement for such bad
: application).

: In this particular case you should be able to automate the processing using
: more reliable methods. For example, why not to use FTP commands in 24x7 to
: do the FTP instead of controlling the command line FTP with sent key? If
: for whatever reason you prefer the command line FTP you can still run it
: automated using an simple FTP script saved as file. The start command
: would be then like below

: FTP -n -smyscript.ftp

: The constants of myscript.ftp file is below
: OPEN servername
: USR myname
: PWD my password
: CD ...some path
: GET .... some file
: etc...

: Similarly you can use command line parameters with pgp and other utilities to
: avoid interactive processing.

: This way you can run the whole thing in any mode as an interactive job,
: standalone scheduler, service, and so on...

Wed Mar 02, 2005 7:57 pm 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.