nnCron Lite Is Not Running Tasks In Cron.tab

nnCron and nnCron LITE discussion

nnCron Lite Is Not Running Tasks In Cron.tab

Postby nnHelp » Tue, 28 Sep 2004, 06:07

I was interested in nnCron's ability to handle "missed tasks", and knowing
that it was recommended on the Pricelessware website, I installed the Lite version to try it out.

Set up is simple enough it seems. However, after creating the tasks in the
cron.tab file per the Cron specification / syntax, nnCron Lite
does not run the tasks.

Things to note:

- nnCron Lite version 1.16 Build 106 16.10.2003

- OS is WinXP Pro SP2 (does nnCron not work with SP2? - everything else on
my PC works with SP2). I have never used any version of nnCron on any other
OS, so I can't confirm whether it would work on win 98, XP SP1, etc.;

- Cron was successfully loaded as a service ... cron.exe shows in Task
Manager;

- Using FileMon from SysInternals, cron.exe can be seen accessing the
cron.tab file each minute as it is supposed to do;

- I have Data Execution Prevention turned on for all applications, and even
though cron.exe did not cause DEP to throw a flag, I included cron.exe in
the exclusions list as a long shot ... this did not help;

- I originally had four tasks in cron.tab using the "missed task" character
("@") on each. To test if this was an issue, I removed the "@" and this did
not help; furthermore, I deleted all of the tasks and replaced them with a
very simple, single task to see if it would run ... no go;

- I ran "cron.exe -reload" after each change of cron.ini and cron.tab to no
avail;

- The log file shows that cron.exe is successfully being loaded and run;

- The tasks in the cron.tab file all run when manually launched;

- I have adequate permissions to run cron as a service in my profile;

- Other "grabbing-at-straws" fixes (too numerous to mention) tried without
success.


Here is my cron.tab:

#CRONTAB FILE
# Classic crontab format:
# Minutes Hours Days Months WeekDays Command
# M H D M WD C

@30 5 * * 1,4 H:\My Documents (H)\Batch Files\XXCopyBackups\Main1AB.bat

@30 5 * * 2,5 H:\My Documents (H)\Batch Files\XXCopyBackups\Main2AB.bat

@30 5 * * 3,6 H:\My Documents (H)\Batch Files\XXCopyBackups\Main3AB.bat

@0 0-23/4 * * H:\My Documents (H)\Batch
Files\XXCopyBackups\MainHourlyAB.bat

Even though the nnCron Lite documentation says you don't have to use quotes
( " ") around paths with spaces, I tried it both ways. Neither way worked.
I also tried with no line feeds between each task ... no go.

Hopefully there is something simple I'm missing in the syntax. As I read
the syntax rules and wrote the tab file at 3:00 am, this is very possible.
:)

Any help is appreciated.

Thank you.

PS

I didn't really want to bring this up in the main discussion as I thought
it might confuse the issue if it was irrelevant. However, upon first
installing nnCron Lite, I checked the nnCron log and it showed several
instances of the same message indicating an error accessing
"etc\taskinfo.txt". I looked up this file in nnCron Lite Help and it says
that this is the file where information regarding missed tasks is stored. I
created a subdirectory "etc" (sub of the nnCron Lite application directory)
and placed an empty text file named "taskinfo.txt" in it. I reloaded nnCron
Lite using the "-reload" switch and the error message disappeared.
Wondering if this subdirectory file should have been automatically created
during installation, I uninstalled nnCron Lite and reinstalled; it still
didn't create the subdirectory / file which I had to again manually create.
Why is this happening? Is it related perhaps to the other issues above?

Again, thank you.
nnHelp
 
Posts: 2
Joined: Tue, 28 Sep 2004, 05:54

Re: nnCron Lite Is Not Running Tasks In Cron.tab

Postby VK » Tue, 28 Sep 2004, 13:47

nnHelp wrote:Set up is simple enough it seems. However, after creating the tasks in the
cron.tab file per the Cron specification / syntax, nnCron Lite
does not run the tasks.


Take a look into 'nncron.out'. If there are some errors? I'm pretty sure the problem is in this line:

Code: Select all
@0 0-23/4 * * H:\My Documents (H)\Batch Files\XXCopyBackups\MainHourlyAB.bat


There is a wrong cron-format in this line. I'm pretty sure you wanted somt like this:

Code: Select all
@0 0-23/4 * * * etc...


However, upon first
installing nnCron Lite, I checked the nnCron log and it showed several
instances of the same message indicating an error accessing
"etc\taskinfo.txt". I looked up this file in nnCron Lite Help and it says
that this is the file where information regarding missed tasks is stored. I
created a subdirectory "etc" (sub of the nnCron Lite application directory)
and placed an empty text file named "taskinfo.txt" in it. I reloaded nnCron
Lite using the "-reload" switch and the error message disappeared.
Wondering if this subdirectory file should have been automatically created
during installation, I uninstalled nnCron Lite and reinstalled; it still
didn't create the subdirectory / file which I had to again manually create.
Why is this happening? Is it related perhaps to the other issues above?


No, don't worry about this. The file etc\taskinfo.txt is created automatically when you start adding tasks to your cron.tab. You don't have to create it manually.
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby nnHelp » Tue, 28 Sep 2004, 14:21

The task syntax I posted was a typo; I actually had the extra "*" as is necessary and as you suggested.

That said, I did find the problem with nnCron not reading (or better put, not being able to read) the cron.tab file. I accidentally saved the cron.tab file in UNIX text format when it should have been saved in DOS text format.

Anyway, I saved cron.tab back to DOS text format, set up a test task and the task ran successfully. Well, almost. The command console which should have been launched flashed for a split second, but the actual XXCopy backup wasn't performed. I checked the nnCron logs and everything appeared OK; the main log showed the task was started and the taskinfo.txt file now showed the "missed task" info.

So, the next logical step was to put quotes around the nnCron task to see if it would run (I had tested both ways previously, but of course it didn't matter because the file had been saved as a Unix format text file). Anyway, after wrapping the command path in quotes, the XXcopy backup task was launched and actually performed as expected.

Next, I tested the same XXCopy batch file task without quotes, but used a simpler path (D:\Backups\Main2AB.bat instead of H:\My Documents (H)\Batch Files\XXCopyBackups\Main2AB.bat). This time the task ran without the quotes. Hmm.

I'm not quite sure why in the absence of quotes nnCron launched the task specified by the longer, complex path name but the actual XXCopy didn't happen (console flashed but XXCopy didn't run). I think this has more to do with passing info to the console than with nnCron, but that still doesn't make full sense to me. Nevermind, as I prefer using the standard quotes that are generally required by command line programs anyway. I'll just use quotes on all the nnCron tasks as it can't hurt, and as I've discovered, it may actually be necessary in some cases.

Thank for the reply.
nnHelp
 
Posts: 2
Joined: Tue, 28 Sep 2004, 05:54

Postby VK » Tue, 28 Sep 2004, 14:51

nnHelp wrote:I did find the problem with nnCron not reading (or better put, not being able to read) the cron.tab file. I accidentally saved the cron.tab file in UNIX text format when it should have been saved in DOS text format.


Ah. Yes. This makes sence.
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: No registered users and 1 guest

cron