SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Drive Letter Assignment/Management (Mapping) From Batch File

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Drive Letter Assignment/Management (Mapping) From Batch File
Author Message
JFEITZIN



Joined: 20 Jan 2011
Posts: 2
Country: United States

Post Drive Letter Assignment/Management (Mapping) From Batch File Reply with quote
We are evaluating the Windows 24x7 Scheduled software as a replacement for our current product (Camellia Software's "Batch Job Server 3.0). We have mostly batch files we run, and from within need to map a network drive. Issueing a "map drive" command statically for a specific drive letter withing one batch, would cause an issue for another batch file if it tried to use the same drive letter. The BJS software offers a way to do this. Inside the batch file you define (REM BJS/DRIVE_LETTERS=2), which dynamically assigns one when when the command is issued (i.e. NET USE %BJS_DRV1%: \\SERVER1\DATA). In order to replace our current software with 24x&, we need to have a way to do this. I could not find any references in the on-line help. Can this software dynamically handle and manage mapped drive letters from batch files? Thanks in advance.
Thu Jan 20, 2011 11:12 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6615

Post Reply with quote
In order to offer a good solution I need to know why drive mapping is required and how it is being used. Why UNC path names aren't good? Please elaborate a bit more on this issue. A sample batch file might be also helpful.


Last edited by SysOp on Thu Jan 20, 2011 1:28 pm; edited 1 time in total
Thu Jan 20, 2011 12:38 pm View user's profile Send private message
JFEITZIN



Joined: 20 Jan 2011
Posts: 2
Country: United States

Post Reply with quote
Thanks for the quick reply. The product we currently have (Batch Job Server 3.0) by Camellia Software, has a "language" you could say. In a regular DOS batch file, you use predefined command words to do and set different things, in the format of (i.e. REM BJS/xxxxxxx). One function/ability is when the batch file is run by the software, it reads any REM BJS/xxxx lines and does certain things. One is to "dynamically" allocate a number of drive letters you need (i.e.REM BJS/DRIVE_LETTERS=2). This way the batch file doesn't have to hard code a "net use X: \\xxxxxxxx) statement. If it didn't, and two batch files were run asking for the same drive letter, you would have an issue. The software "handles" this situation for you. Also, becase the software "commands" are all prefaced with REM, if you want to just use the batch file from a PC in your organization, it just "ignores" all those statements, as they are only applicable for when it's run from the BJS server. We have hundreds of batch files that do all kind of network accessing, and they are run at all times during the day. We need a way for the batch files to handle drive letters, and BJS does that. Can your software do this? I've included "part" of a production bacth file as an example. Thanks again for the quick reply. I/we have several other questions regarding if your software can do the things our current one is doing. I guess I will open separare questions for each one. BJS allows you to "submit" jobs to it by simply copying a batch file to a particular directory. Once copied there, it runs on the BJS server. We need to be able to do this. It also allows you to submit jobs by running a SUBMTJOB program from any PC, which contacts the server and sends the job to it to be run. Again, I suppose I will post a specific question for each function we are looking to make sure your software can do. Thanks again.


EXAMPLE FOR DRIVE LETTER:
echo off
rem **********************************************************************
rem AFDAD.BAT
rem **********************************************************************
echo on
REM BJS/MAX_ELAPSED=900
LOG AFDAD IN %1 %3 %4 %5 %6 %7
cd \temp
rem This batch job prints the ad sheets from the mainframe
rem Resp Pgmr: ESMITH
CALL BR

REM BJS/END_JOB_ON_END_OF_BATFILE
REM BJS/PURGE_AFTER=2880
REM BJS/DRIVE_LETTERS=2
REM BJS/JOB_CLASS=ONE
REM BJS/SINGLE_THREAD
NET USE %BJS_DRV1%: \\YAPP1\DATA
if ERRORLEVEL 1 goto YappErr1
%BJS_DRV1%:
CD \MFDOWN\DATA

NET USE %BJS_DRV2%: \\YAPP1\CMDS
if ERRORLEVEL 1 goto yapp1err
%BJS_DRV2%:

copy %BJS_DRV1%:%1 \\server1\data\common\common\

bjc set_job_status job_no=%bjs_job_no% job_status=%errorlevel%

copy %BJS_DRV2%:%1 \\server1\data\common\common\

bjc set_job_status job_no=%bjs_job_no% job_status=%errorlevel%

end
*********************************************
EXAMPLE FOR SUBMIT JOB Question:
REM BATCH FILE TO SUBMIT BATCH FILE TO BJS SERVER
echo on
LOG ADSGDNL IN
SUBMTJOB /S:YBATCHSRV1 \\SERVER1\CMDS\WINNT\ADSGCOPY.BAT %1 %2 %3 %4 %5
if errorlevel 1 goto nosub
goto end
:nosub
rem no submission to batch server
goto end
:end
LOG ADSGDNL OUT
Thu Jan 20, 2011 1:08 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6615

Post Reply with quote
Thanks for the provided information. From your description it sounds like Camellia's Batch Job Server uses proprietary extensions to common DOS batch files. While I'm sure that similar things can be done in other products, I don't think you can find a 3rd party product that will do the same things exactly as it is done in Camellia's Batch Job Server, its like trying to fit a square ping into a round whole.

What you are asking in this topic, shouldn't be done the Camellia's way in 24x7.

24x7 supports several scripting languages, which are generally much more advanced than the DOS batch interface. They support many control of flow methods and functions that aren't available in DOS batch files due to DOS batch "language" limitations. For example, they provide extensive support for variables, error handling, loops, conditional operations, advanced file processing, emails, ftp/sftp/ftps, telnet, database operations, file replication and synchronization, just to name a few... that long list goes on an on.

Having said that, the internal implementation of jobs is very different in 24x7. You don't need to submit anything every time you need to run a job. You setup the job definition once, using graphical tools (or programmatic interfaces) and then assign some schedule or events to trigger that job. You can setup the job to run locally or remotely, failover if the remote server is down, etc… You can control job sequencing, priorities, etc… Of course you can add jobs dynamically from graphical interface, from command line, from scripts, from web applications, there are multiple methods and APIs available. You add a job definition once, and you don't need to "submit" it on every run.

If you simply need to run an existing job on demand, there are many ways for trigger it. Again you can use command line with parameters, Remote Console (web or GUI), or program your own interface, if you have time for that.


If I have missed anything, please let me know.

If you have any specific questions, or need a suggestion for how implement certain things, please don't hesitate to post them in this support forum.
Fri Jan 21, 2011 10:31 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.