Wake

nnCron and nnCron LITE discussion

Wake

Postby paper » Sun, 18 Dec 2005, 04:27

Hi just found out about nnCron and i am very interested. Can somebody write a script that would turn on my copmuter every day at 9 pm and turn it off at 10 pm? Please i would take the tmie to read this but im going out of town for a week and have to leave in 20 minutes. Please help me out.
paper
 
Posts: 3
Joined: Sun, 18 Dec 2005, 04:24

Postby paper » Sun, 18 Dec 2005, 04:48

nvm i still have another hour but stil any help is great
paper
 
Posts: 3
Joined: Sun, 18 Dec 2005, 04:24

Postby Valery_Kondakoff » Sun, 18 Dec 2005, 11:56

Code: Select all
#( test_shutdown
\ starting at 10 pm
Time: 0 22
Action:
\ setting timer to wake the PC in a 23 hours
WakeAfter: 23:00
\ shutting downn the PC
FORCE-SHUTDOWN
)#


docs:
http://www.nncron.ru/help/EN/working/cron-format.htm
http://www.nncron.ru/help/EN/commands/p ... m#SHUTDOWN
http://www.nncron.ru/help/EN/working/pl ... up.spf.htm

HTH!
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby paper » Mon, 19 Dec 2005, 08:18

Thanks alot, so i would make a new task and put run a script as action? On event or how would that work.
paper
 
Posts: 3
Joined: Sun, 18 Dec 2005, 04:24

Postby Valery_Kondakoff » Mon, 19 Dec 2005, 12:30

just place the source text in nncron.tab.
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby semko » Tue, 03 Jan 2006, 12:21

Hi Valery,
[quote="Valery_Kondakoff"]
Code: Select all
#( test_shutdown
\ starting at 10 pm
Time: 0 22
Action:
\ setting timer to wake the PC in a 23 hours
WakeAfter: 23:00
\ shutting downn the PC
FORCE-SHUTDOWN
)#


Your example has one disadvantage: the computer must be up and running at 10 pm to set the wake-up time. Also, the other example in the docs that uses Watch-Resume to set the wake-up time is not the perfect solution. What, if you need to wake up the machine more than once, at different times?

There really should be a way to define optional wake-up times for every task within the task itself.

Sem
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Postby Valery_Kondakoff » Tue, 03 Jan 2006, 12:41

semko wrote:There really should be a way to define optional wake-up times for every task within the task itself.


So, what is the problem? Use the IF...ELSE...THEN and set different wake-up times inside based on specified conditions... (http://www.nncron.ru/help/EN/working/nn ... rth.htm#IF ).
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby semko » Tue, 03 Jan 2006, 14:15

OK, Valery, let me see if I get you right.

Task1:
- run at 2 am
- does it's work
- at the end, sets wake-up time to 2 am (next day)
- power-hibernates

Task2:
- run at 4 am
- does it's work
- at the end, sets wake-up time to 4 am (next day)
- power-hibernates

Will the wake-up time set in task1 (2 am) will still be remembered after task2 has been run?

Sem
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany

Postby Valery_Kondakoff » Tue, 03 Jan 2006, 15:46

No. As far as I know there is only one wake-up timer which can be set in motherboard BIOS. Thus, the timer will be reset after you run the second task.

But why don't you use smth like flag-file to let the second task _not_ to reset the timer?

Smth like this:

Task1:
- run at 2 am
- does it's work
- at the end, sets wake-up time to 2 am (next day)
- create file-flag
- power-hibernates

Task2:
- run at 4 am
- does it's work
- at the end, check if the file-flag exists. If it does not exists sets wake-up time to 4 am (next day). If it exists just deletes the file flag without resetting the wake-up timer.
- power-hibernates
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby semko » Tue, 03 Jan 2006, 16:33

It would be great if nncron could handle that for me. Just like the way the Windows task scheduler does it :-)

But anyway, I'll try it the way you suggested. Thank you very much, Valery.

Sem
semko
 
Posts: 46
Joined: Sat, 08 Oct 2005, 17:42
Location: Germany


Return to nnCron forum (English)

Who is online

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