nncron ignoring "time"?

nnCron and nnCron LITE discussion

nncron ignoring "time"?

Postby rucksman007 » Mon, 07 Jul 2008, 09:33

Hi,

as discussed in the other thread, I want to wake up my PC from supend mode every 30 minutes from monday to friday from 9:00-17:00, do something, and got to standby again.

The good news is, that the task works.

The bad news is, that for some strange reason the task completely ignores "time". This means, that even after 17:00, it is still doing all the alle the stuff it is supposed to do.... Anythign worng with my "time" command????? Or some other error?

This is my task:
#( task1
Time: * 9-17 * * 1-5 *
WatchSuspend
Action:
WakeAfter: 00:30
)#

#( task2
Time: * 9-17 * * 1-5 *
WatchResumeAuto
Action:
.....
POWER-SUSPEND
)#
rucksman007
 
Posts: 11
Joined: Mon, 30 Jun 2008, 09:32

Re: nncron ignoring "time"?

Postby SeMa » Mon, 07 Jul 2008, 17:42

Time: * 9-17 * * 1-5 *
The 1st asterisk means ANY minute. After 17:00 also.
Code: Select all
Time: * 9-16 * * 1-5 *

Or if it is necessary precisely at 17:00 also
Code: Select all
Time: * 9-16 * * 1-5 *
Time: 0 17 * * 1-5 *
Компьютер ─ устройство, разработанное для ускорения и автоматизации человеческих ошибок
User avatar
SeMa
 
Posts: 637
Joined: Fri, 15 Apr 2005, 12:49
Location: Украина

Re: nncron ignoring "time"?

Postby rucksman007 » Mon, 07 Jul 2008, 23:34

Hi,
thanks for your answer.

So did I get it right, that with "Time: * 9-17 * * 1-5 *" it will stop at 17:59? When trying yesterday, it even worked after 18:00. So obviously there should be another problem. Maybe the script it too simple in a way?????
rucksman007
 
Posts: 11
Joined: Mon, 30 Jun 2008, 09:32

Re: nncron ignoring "time"?

Postby rucksman007 » Tue, 08 Jul 2008, 10:47

Well, unfortunately my script seems to be indeed a little bit too simple - it does not work properly.

When switching the PC on and putting it in standby mode BEFORE 09:00, it simple does not wake up. My hope was that nncron is constantly watching the tasks (without evaluating "time"), and as soon as the "time" command applies, it starts to operate. Obviously this does not apply to my script.

Any idea how to modify this script so that is works?????
rucksman007
 
Posts: 11
Joined: Mon, 30 Jun 2008, 09:32

Re: nncron ignoring "time"?

Postby SeMa » Tue, 08 Jul 2008, 18:14

I don't know what problem is. Your tasks (modified slightly) work perfectly!

Code: Select all
#( wake-task1
Time: * 9-15 * * 1-5
WatchSuspend
Action:
WakeAfter: 00:10
)#

#( wake-task2
Time: * 9-15 * * 1-5 *
WatchResumeAuto
Action:
S" +++ waking up! +++" CRON-LOG
30000 PAUSE
S" *** Now %hh%:%mm% **** I'll be back in 10 minutes ***%crlf%" CRON-LOG
30000 PAUSE
POWER-HIBERNATE
)#

Scrap of log:
08 Jul 15:10:00 2156 TASK: wake-task1
08 Jul 15:20:21 3120 TASK: wake-task2
08 Jul 15:20:21 3120 +++ waking up! +++
08 Jul 15:20:51 3120 *** Now 15:20 **** I'll be back in 10 minutes ***

08 Jul 15:20:51 3120 Start result: 0
08 Jul 15:21:21 3528 TASK: wake-task1
08 Jul 15:31:42 1192 TASK: wake-task2
08 Jul 15:31:42 1192 +++ waking up! +++
08 Jul 15:32:12 1192 *** Now 15:32 **** I'll be back in 10 minutes ***

08 Jul 15:32:12 1192 Start result: 0
08 Jul 15:32:42 3744 TASK: wake-task1
08 Jul 15:43:03 252 TASK: wake-task2
08 Jul 15:43:03 252 +++ waking up! +++
08 Jul 15:43:33 252 *** Now 15:43 **** I'll be back in 10 minutes ***

08 Jul 15:43:33 252 Start result: 0
08 Jul 15:44:03 2952 TASK: wake-task1
08 Jul 15:54:24 3552 TASK: wake-task2
08 Jul 15:54:24 3552 +++ waking up! +++
08 Jul 15:54:54 3552 *** Now 15:54 **** I'll be back in 10 minutes ***

08 Jul 15:54:54 3552 Start result: 0
08 Jul 15:55:24 2084 TASK: wake-task1

As you see wake-task1 have operated last time BEFORE 16:00 - set up wakeup timer at 16:05.
PC have woken up in due time. But wake-task2 have no more operated as its time has already passed.

Yes, your script is simple for your task decision. Try this script with new words by AlikaS from other thread:
Code: Select all
#( task1
Time: * 9-16 * * 1-5 *
WatchSuspend
Action:
WDay@ 5 = INTERVAL: 16:31-16:59 AND
IF
    WakeAtWd: "09:00" 1
ELSE
    WakeAfter: 00:30
THEN
)#

#( task2
Time: * 9-16 * * 1-5 *
WatchResumeAuto
Action:
.....
POWER-SUSPEND
)#
Компьютер ─ устройство, разработанное для ускорения и автоматизации человеческих ошибок
User avatar
SeMa
 
Posts: 637
Joined: Fri, 15 Apr 2005, 12:49
Location: Украина

Re: nncron ignoring "time"?

Postby rucksman007 » Tue, 08 Jul 2008, 18:44

Well, the problem is, that I started my PC this morning well before 09:00. I did put it into standby mode. And since then nothing happened. The PC did not wake up.Maybe the problem is that the script tells the PC to watch for suspend mode from 09:00 on. But as the PC is already in standby mode, maybe nncron is not recognizing it as "WatchSuspend", because it IS already in stanby mode und not GOING into standby mode....

And i really have problems understandind this Forth language. It is so different from all other languages I normally one would code. So what does yout task1 exactly do???? I do not understand the part:

WDay@ 5 = INTERVAL: 16:31-16:59 AND
IF
WakeAtWd: "09:00" 1
ELSE
WakeAfter: 00:30
THEN

My interpretation would be: If it is friday and between 16:31 and 16:59, then wake up on monday at 09:00. Otherwise wake up after 30 minutes. Correct? But I would never be able to code such a script. This language is horrible....

Normally I would say

If WDay@ = 5 AND INTERVAL = 16:31-16:59 THEN
WakeAtWd: "09:00" 1
ELSE
WakeAfter: 00:30
ENDIF

Well, at least somethign like that (I am not am IT professional.....)
rucksman007
 
Posts: 11
Joined: Mon, 30 Jun 2008, 09:32

Re: nncron ignoring "time"?

Postby SeMa » Tue, 08 Jul 2008, 22:37

Maybe the problem is that the script tells the PC to watch for suspend mode from 09:00 on. But as the PC is already in standby mode, maybe nncron is not recognizing it as "WatchSuspend", because it IS already in stanby mode und not GOING into standby mode...
That's right.
My interpretation would be...
That's right too.
This language is horrible...
:D This language very differs from others, but it is very powerfull! One of its power is based on its stack and stack operations. From here is its "starnge" notation.
Компьютер ─ устройство, разработанное для ускорения и автоматизации человеческих ошибок
User avatar
SeMa
 
Posts: 637
Joined: Fri, 15 Apr 2005, 12:49
Location: Украина


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest