Problem with job scheduled every 3 days

nnCron and nnCron LITE discussion

Problem with job scheduled every 3 days

Postby Z-VAP » Fri, 11 Mar 2005, 02:51

I downloaded nncron lite. Pretty good program. Better than most of the others. However I am having trouble with a task I created.

I got this app that I need to schedule to run every 3 days at 6:00 PM. The job I have is:

Code: Select all
@0 18 */3 * * C:\Temp\job_1.vbs


It doesn't seem to be acting as it should though. So I changed the day portion as follows:

Code: Select all
@0 18 1-31/3 * * C:\Temp\job_1.vbs


This works but it resets to the first day every month.

Any idea what I am doing wrong?
I believe I am using version 1.16.

Thank you,
Joe
Z-VAP
 
Posts: 4
Joined: Fri, 11 Mar 2005, 02:36

Postby VK » Fri, 11 Mar 2005, 13:14

Please, be more specific: what are the problems with '*/3' syntax? It works well on my PC - exactly as '1-31/3' syntax. This follows the crontab concept ( http://www.nncron.ru/nncronlt/help/EN/w ... format.htm ):
After an asterisk (*) or a range of values, you can use character / to specify that values are repeated with a certain interval between them. For example, you can write "0-23/2" in Hour field to specify that some action should be performed every two hours (it will have the same effect as "0,2,4,6,8,10,12,14,16,18,20,22"); value "*/4" in Minute field means that the action should be performed every 4 minutes, "1-30/3" means the same as "1,4,7,10,13,16,19,22,25,28".

You may take a look at the 'big' nnCron (not the LITE one) - it has a special 'advanced' syntax wich is much more powerful than the original cron-syntax. You can play with the DATE-INTERVAL: word to launch your task every 3 days. ( http://www.nncron.ru/help/EN/commands/d ... TEINTERVAL )
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby Z-VAP » Sun, 13 Mar 2005, 23:22

I can't remember what was wrong. I think it was running every day. Perhaps I'll mirror the job with the other one, and see if it does what it should.

I'll report back.
Z-VAP
 
Posts: 4
Joined: Fri, 11 Mar 2005, 02:36

Postby Z-VAP » Thu, 17 Mar 2005, 02:29

Well, here's the logs of the past several days worth of activity. I added the other job with */3 instead of 1-31/3.

As you can see on 3/13 was the first day of activity. For some reason, the app wanted to flag it as a [missed] tasks, when it wasn't.

On 3/14 there was no activity at all. (a good thing)

On 3/15 it ran the second job again for some reason.

Then today (3/16), it ran it like the 13th, with the second job flagged as [missed] again.

Attached are my logs.


Code: Select all
0311   17:16:34 1144 Load cron.tab
0311   18:15:01 2760 Start: C:\Temp\Avast Scan.ahk
0311   18:15:01 2760 Start result: 0
0312   18:01:52 1096 Start nnCron
0312   18:01:52 1096 Load cron.tab
0312   23:23:10 1092 Service stopped.
0313   09:22:17 1096 Start nnCron
0313   09:22:17 1096 Load cron.tab
0313   17:46:30 1096 Load cron.tab
0313   17:47:30 1096 Load cron.tab
0313   18:00:00 2968 Start: C:\Temp\job_1.vbs
0313   18:00:00 2968 Start result: 0
0313   18:02:00 3120 Start [missed]: C:\Temp\job_2.vbs
0313   18:02:00 3120 Start result: 0
0314   09:17:44 1144 Start nnCron
0314   09:17:44 1144 Load cron.tab
0315   17:20:25 172 Start nnCron
0315   17:20:25 172 Load cron.tab
0315   18:00:00 3792 Start: C:\Temp\job_2.vbs
0315   18:00:01 3792 Start result: 0
0316   04:38:33 1028 Start nnCron
0316   04:38:33 1028 Load cron.tab
0316   18:00:00 796 Start: C:\Temp\job_1.vbs
0316   18:00:00 796 Start result: 0
0316   18:02:00 3128 Start [missed]: C:\Temp\job_2.vbs
0316   18:02:00 3128 Start result: 0
Z-VAP
 
Posts: 4
Joined: Fri, 11 Mar 2005, 02:36

Postby VK » Thu, 17 Mar 2005, 11:38

Look what happens. The syntax '*/3' works exactly as '1-31/3'. So, it will run at every day of the month that is divisible by 3: 1, 3, 6, 9, 12, 15, 18 ... 30. This is how the original Unix 'cron' works.

If you want to launch the task every three days from the time it was started, use the 'big one' nnCron with it's advanced syntax (as I already suggested).

As of the 'missed' task handling: I added the test task to my cron.tab:
Code: Select all
@0 18 1-31/3 * * cmd.exe /c dir
@2 18 */3 * * cmd.exe /c cd
Let's see if I can reproduce the problem. In the meantime you can test if you can reproduce this problem with the latest nnCron LITE beta: http://www.nncron.ru/forums/viewtopic.php?t=414

BTW, it's interesting what do you have in your etc\taskinfo.txt file?
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby VK » Fri, 18 Mar 2005, 19:02

Ooops... Excuse me, I was wrong when saying that '*/3' and '1-31/3' syntaxes are the same. Following the classic cron-format the syntax '*/3' will run staring from 0: on 3, 6, 9, 12, 15, 18 etc... The syntax '1-31/3' will run starting from 1 (1, 4, 7, 10...). The syntax '2-31/3' will run starting from 2 (2, 5, 8, 11...) etc.
CU
VK
User avatar
VK
 
Posts: 680
Joined: Wed, 14 Jul 2004, 19:17

Postby Z-VAP » Sat, 19 Mar 2005, 19:33

OH!! I think I get it now. Well, at least I understand what its doing..

So no matter which I choose, they'll reset at the beginning of the month. No biggie. Maybe I will check out the bigger version of nnCron.

Thanks
Z-VAP
 
Posts: 4
Joined: Fri, 11 Mar 2005, 02:36


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 2 guests