problem with perl

nnCron and nnCron LITE discussion

problem with perl

Postby Spike » Tue, 28 Sep 2004, 23:06

I'm using the current version of nncron lite 1.16 and have one entry in my cron.tab file:

* * * * * g:\ftp\test\filemove.pl

This is a perl script and it does not appear to be running. The perl script should have created/updated a log file every time it runs and then move a file from one folder to another. The log file is not being created and the file is not being moved to another folder.

I found the following information in log file created from nncron lite:
15:00:00 4672 Start: g:\ftp\test\filemove.pl
15:00:00 4672 Start result: 0

Based on this, it appears to be doing something, but not running.

I have two questions on this.
1.) Why is this not running correctly
2.) When this job runs, what is the working directory that's being using for the job?

By the way, I can run the perl script from the command line and it works fine.
Spike
 
Posts: 3
Joined: Tue, 28 Sep 2004, 22:54

answer found

Postby Spike » Wed, 29 Sep 2004, 00:04

I think I found the answer to my own problem. I created a bat file to run the perl script to setup the working. The script seems to be working now.
Spike
 
Posts: 3
Joined: Tue, 28 Sep 2004, 22:54

Re: problem with perl

Postby VK » Wed, 29 Sep 2004, 11:02

Spike wrote:
1.) Why is this not running correctly


There are several possibilities why the script is not run:

1) User environment variables. nnCron LITE is started from the System account, so it can not access the variables (if any) set to the currently logged user. To fix this just make all perl- or path-related env. variables system.

2) Files with .pl extension may be registered to be launched by perl.exe to the currently logged user, but not the System one

3) Working dir problem. (I think this is your problem).

2.) When this job runs, what is the working directory that's being using for the job?


When a program is launched by nnCron LITE the nnCron LITE installation dir is used as working dir. You can change it in bat-file (as you did already as far as I understand) or by modifying your cron.tab. More info: http://www.nncron.ru/nncronlt/help/EN/w ... tm#crontab

HTH!
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17


Return to nnCron forum (English)

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron