SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
RunAndWait doesn't complete the job
Goto page 1, 2  Next
 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
RunAndWait doesn't complete the job
Author Message
yuriyv



Joined: 27 Nov 2007
Posts: 3
Country: United States

Post RunAndWait doesn't complete the job Reply with quote
Hi,

One of my jobs is having a trouble finishing encryption if the job initiated by scheduler, but when I run very same job manually it works fine. This job is actually a duplicate of another one that had no problems running as scheduled. The difference is that in older job file was FTP’d in the new one it sends encrypted file via e-mail.

Encryption code (line 24):
// creates encrypted “file_name” file
RunAndWait( encrypt_command, "", 120, process)

Following send mail code (line 25):
// sends file
MailSendWithAttachment( "user@users.com", "pswrd", "recipient@recipients.com",
"Your file to view", "Please view the attachment.", file_name)

Error exit code: 162

Error: The file “file_name” (line 25) does not exist.
Tue Nov 27, 2007 1:39 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
Does the enrypt_command print anything to the console when executed manually in DOS?

If it does, try capturing and analysing the output of the command, for example,

Code:
ConcatEx( "cmd /C ",  encrypt_command, " > c:\\encrypt_command.log",  encrypt_command )
RunAndWait( encrypt_command, "", 120, process )

Run it and check c:\encrypt_command.log for details. Please let us know what you see there.
Tue Nov 27, 2007 2:16 pm View user's profile Send private message
yuriyv



Joined: 27 Nov 2007
Posts: 3
Country: United States

Post log file is empty Reply with quote
in 24/7'th job log i got the same error "file_name doesn't exist" with exit code 162.

in the c:\...log file there was no notes at all.
Tue Nov 27, 2007 3:15 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
I guess you have to agree that the information you provided is insufficient to help you. Saying "I have an error in line 125" is not helpful, or "in 24/7'th job log i got the same error"

If you want to get help, please be more forthcoming, tell us what encryption program you use, how you start it, let us see the complete command line or better your job code, to ensure you don't have any syntax of logical errors in the code; post the output of the log file, etc.. whatever else is important to know about the process to understand how it is being setup and run. You might have a simple logical error in the script, but nobody can help to find it if we cannot see it. I am looking forward to learn more about the job so I can really start helping you.
Tue Nov 27, 2007 3:32 pm View user's profile Send private message
yuriyv



Joined: 27 Nov 2007
Posts: 3
Country: United States

Post forthcoming Reply with quote
I though I did all that in my initial posting. It has real code lines, their positions in the code and errors it generates.
I specified line numbers so that you can see that the encryption line is right on top of the mailing line in the code and that is exactly where error occurs.

The error occurs only when 24/7 Scheduler application is running as a service and executes scheduled jobs automatically. When I stop 24/7 Scheduler service and open it as a windows client I run the very same job manually and it completes without errors.

I guest I could explain my last posting better. I am apologizing if I was too short in it. The "24/7'th job log" is referring to 24/7 Scheduler application's Job Log tab. When you click on the job's name in the left side of the application the Job Log tab becomes available on the right site of the application showing job's progress and/or errors. Please let me know if you need more details.

After inserting a line that you sent to me for the test I scheduled the job to run again just to see if there will be any additional information in the log file on "C:\" drive. It was empty (the subject of my last posting).

When I ran the same job manually, it completed all lines of code successfully sending mail. The log file on "C:\" drive was still empty.
Tue Nov 27, 2007 4:23 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
Thanks for the info. The original post contained only a few lines of code, just a small fragment. My main suspicion was that you have some common scripting error causing the incorrect processing. The key phrase came in your last post

Quote:
The error occurs only when 24/7 Scheduler application is running as a service and executes scheduled jobs automatically. When I stop 24/7 Scheduler service and open it as a windows client I run the very same job manually and it completes without errors.


I can say almost for sure that you are dealing with a security related issue.
Likely cause #1: The service is running under a different user account with different security settings, environment variables and file access permissions
Likely cause #2: You are referring to networked files using drive mappings. Drive mappings are not available to services and processes launched from services. You should use UNC file names instead.

Please let us know if neither of that helps.
Tue Nov 27, 2007 4:33 pm View user's profile Send private message
roadrunner



Joined: 19 Feb 2008
Posts: 15
Country: United States

Post Reply with quote
any examples running UNC from the command line in the job properties? We are changing from mapped drives to UNC's and I understand that UNC's in command line mode are different then from using the run. Thanks
Tue Mar 25, 2008 2:50 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
For a program type or run document type job, enter something like

Code:
\\SERVER_NAME\SHARE_NAME\Folder1\Program.exe command line parameters here


When doing it from RunAndWait or other JAL statements in script jobs or script type job actions, do not forget about special ASCII characters and that back-slash is used as an escape symbol. You should either double every backslash or change the escape symbol in preferences.

Example:

Code:
RunAndWait( "\\\\SERVER_NAME\\SHARE_NAME\\Folder1\\Program1 command line parameters here", "", 120, process )

Tue Mar 25, 2008 2:58 pm View user's profile Send private message
roadrunner



Joined: 19 Feb 2008
Posts: 15
Country: United States

Post Reply with quote
.bat files any different, I get an error message "unable to find \\server name\...make.bat"
Tue Mar 25, 2008 3:13 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
Same stuff. Please provide the complete command line exactly as it is entered. You can substitute any user names or password with asterisks
Tue Mar 25, 2008 3:38 pm View user's profile Send private message
roadrunner



Joined: 19 Feb 2008
Posts: 15
Country: United States

Post Reply with quote
job command line: \\server name\share\sub directory\run.bat

run.bat;
call 2DBF.BAT
call index.bat

2dbf.bat
REM EXTRACTS 21 DBF FILES FROM x AND DUMPS THEM INTO \\server name\share\sub directory

\\server name\share\sub directory
(errors out here still at the C:\, *.DBF not recongized)
DEL *.DBF
DEL *.CDX

START /W DBF.EXE

Its probably a syntax error not sure how the commands should be when using UNC's.
Thank you

The bat file is erroring out
Tue Mar 25, 2008 4:13 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
Well, since I didn't provide the command line exactly, it is difficult to help you with that. Who knows what you enter there.

Just a suggestion, look for spaces and other special symbols. If necessary enclose names with spaces in double quotes. You should be able to run the entered command line from DOS prompt using copy & paste without any additional changes. If you can do it, you should be able to run it in 24x7.
Tue Mar 25, 2008 5:17 pm View user's profile Send private message
roadrunner



Joined: 19 Feb 2008
Posts: 15
Country: United States

Post Reply with quote
having issues running a del *.dbf in a .bat file. Tried using the unc in front of the del command and quotes as well. Any suggestions?
Wed Mar 26, 2008 10:59 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
del '\\server\share\folder\*.dbf"
Wed Mar 26, 2008 2:44 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
What error message do you get?
Wed Mar 26, 2008 2:44 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
Goto page 1, 2  Next
Page 1 of 2

 
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.