lsatenstein
14th October 2002, 17:51
Baan version 4c4, sp 6 (NT)

I have to create a file in e:\ship_data\ directory. The file name has the format cust#_date_time.txt

When the session is run manually from the developer's machine, the file does get created as it should. When the session is run from a job (owner is baan), the output file gets created in ${BSE}\tmp

Any ideas why I can create it appropriately, but as a job, it does not go to the same destination?

Leslie

mark_h
14th October 2002, 18:05
Do not know much about jobs on NT, but have you compared the paths between the job user and a normal user? I know on UNIX the paths are different so when we are running a job to a file we always use the full path.

Mark

benito
14th October 2002, 23:59
Try UNC paths...for example

\\computername\D\folder

Works all the time for me.

good luck

OmeLuuk
15th October 2002, 00:26
Rembember that the job user must have:
1) Same paths as manally run (so persistent drive mappings can be used)
2) Sufficient rights on the path (note that the user may locally on the baan server have other rights / password than on the domain)
3) Access to the same path: d:\whatsoever looks like a local path on the developer's machine, but the job is run from the server so that path there points to a (non exising?) path on the server...

You can use UNC paths, but still need enough credentials to write there too.

grzegorz
15th October 2002, 09:41
I just wrote a post in another thread that may also match here. Probably it is from the same family..

http://www.baanboard.com/baanboard/showthread.php?s=&threadid=7156

lsatenstein
15th October 2002, 15:23
In a previous post there was an example of using the \\computername as a high level qualifier. How do I get my computer name dynamically?


I would like to actually like to get ${BSE}\tmp
from the environment, and parse and extract the disk id, as my ship_data directory is on the same drive as the \baan directory.

I am using baan 4c4 and don't see any function calls such as getenv("env_name")

Can you point to them?

lsatenstein
15th October 2002, 15:25
Gentlemen. The path I chose was on the same server as the Baan application.

I would like to dynamically build the file name, and have the following snippet.


domain tcmcs.str132 filename

'...........

cwd = getcwd() |LSS 021014 n
x = pos(cwd,"\") |LSS 021014 n
dir = cwd(1;x) & "ship_data\" |LSS 021014 n
|* e:\shipdata\ is the result

secondstamp = secs.now() |LSS 021009 n returns hhmmss as long
filename = sprintf$(
"%s%d_%D(%02y%02m%02d)_%06d.txt",
dir,suno.f,date.num(),secondstamp)

secondstamp is the time as a long with value hhmmss

When filename is opened manually (debug or manual run, it is fine. Directory permissions are r/w for everyone.
jobdaemon is the other user .

Any more Ideas please


__________________
Mr. Leslie

mark_h
15th October 2002, 21:52
It seems to me I read a post somewhere about the "\"'s and NT. I think the directory name may need to be e:\\salesdata\\filename. The problem is I can not find the post and I am not an expert on NT.

Also are the drive mappings the same? Could it possibly be that e: is mapped differently between the users? Just some guesses.

Mark

benito
15th October 2002, 22:35
The reason why I suggested UNC path in the first place is to take care of incorrect mapping. I think Omeluuk has explained quite clearly in his post what could be the problem. The reason why the file ends up at the tmp directory is because Baan cant find the path. I don't think its the permission problem either but just to be sure try this,

Folder properties > Security > Permissions

Check "Replace permission on subdirectories". Just to be very sure add the name of the person executing the job. I noticed you said the owner is "Baan". It really doesn't matter who owns the job. It's the name that logs on you should worry about.

So you dont get confused at directories, go to your Windows Explorer > Tools > Folder Options

Check both
"Display full path in the address bar"
"Display full path in the title bar"

Check to see that paths exist on the machine you are running the job. Good luck.

lsatenstein
15th October 2002, 22:43
Today, logged as administrator (logon id baan) *NT on the server.


The file, when the session is run manually, goes to the correct subdirectory.

When the session is in a step in the night jobstream, the job-daemon initiates the job and the session runs as a step. Then, as I indicated, the outputs (2 files) go to the baan\tmp directory.

The NT administrator has no restrictions on the use/abuse of this directory. We took away all restrictions in an attempt to circumvent the problem, if it was security based.

Leslie