Tags:
create new tag
view all tags

Question

I would like to use nnCron LITE as described in CronTabWin. The nnCron is installed as a service and works as expected.

However, I am not able to discover, how the unix command has to be transformed in order to work in the Windows/cygwin environment (e.g. for the mailnotify script).

Is there anybody who uses a cron clone for Windows? A working example of a simple unix command like (cd /path/to/twiki/bin; ./mailnotify -q) using Windows syntax would be very helpful!

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Windows 2003
Web server: Apache 1.3.33
Perl version: 5.8.6
Client OS: Windows 2000
Web Browser: Firefox 1.0, MS IE 5.5
Categories: Platform, Installation

-- MichaelSchmidt - 19 Jan 2005

Answer

The Windows syntax is very similar - put this in a .bat or .cmd file:

cd d:\path\to\twiki\bin
mailnotify -q 

Since it's easy to get the environment wrong, it's worth doing set >c:\temp-env.txt to check. You can also run testenv >some-file.txt from cron to if your config is OK.

-- RichardDonkin - 21 Jan 2005

It sounds simple, and this is exactly what I tried before. However, the result is not what I expect.

This is the echo of the execution of the .bat file:

C:\Programme\cron>d:
D:\twiki\bin>cd \twiki\bin 
D:\twiki\bin>mailnotify -q 
D:\twiki\bin>c:\cygwin\cygwin.bat  0<"(cd /twiki/bin; ./mailnotify -q; exit)" 
This looks reasonable. However, after this it says something like "system path not found".

Could you, please, explain the essentials of the environment settings that have to be checked? And what is required to make the testenv script work as a stand-alone tool? In my Windows installation the testenv works only, if called by the web server or from the cygwin bash. When I call the script from the Windows command line it says "command not found".

-- MichaelSchmidt - 01 Feb 2005

After making some experiments I found, that the problem is the definition of the search path within the perl environment (the actual content of the variable @INC).

Finally, I found a solution that works fine for my Windows environment: I renamed the "mailnotify" script into "mailnotify.pl", removed the shebang line and wrote the following .bat file (The programs are located on drive c: while the twiki files are located on drive d:):

d:
cd \twiki\bin
perl mailnotify.pl -q
exit

This script is ivoked by the cron clone on a regular basis and works as expected.

-- MichaelSchmidt - 03 Feb 2005

For me, this worked: I made a file "wikimailnotify.bat", with lines

cd c:\twiki\bin
c:\cygwin\bin\perl.exe -T mailnotify
Then I simply run this file with cron.

-- MikkoLaakso - 13 Oct 2005

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2005-10-13 - MikkoLaakso
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.