Time Specifiers

As their name implies, time specifiers are used to specify when and how often a task should be executed. Time specifiers are placed in the beginning of a task before the Action: section.

In most cases, word Time: is used to specify the starting time and frequency of task execution.

Time: <time in cron format>

A task may contain more then one instance of word Time:; in this case, the action will be performed at each of the specified moments.

Actually, a task may contain no Time: section at all, which would have the same effect as an instruction to run the task each minute. Time: section is often omitted as unnecessary in task which are supposed to be started only manually. In this case, the task should deactivated with NoActive option.

Example:

#( test_task
\ task is started on nnCron startup and at the beginning of every hour
Time: START-TIME
Time: 0 * * * * *
Action:
    \ ... performing some useful actions
)#
#( test_task1 \ the task is started at 10:00 on weekdays and at 12:00 at weekends Time: 0 10 * * 1-5 * Time: 0 12 * * 6,7 * Action: \ ... performing some useful actions )#

#( test_task2
\ 'Time:' section is absent, so the task
\ will be executed every minute

Action:
\ ... performing some useful actions
)# #( test_task3
\ task is going to be started manually, so 'Time:' section is not required
NoActive
Action:
\ ... performing some useful actions
)#


Time: <time_in_cron_format>

This construct is used to specify at what time(s) a task will be executed. Time should be in "cron format", i. e.

Time: <Minutes> <Hours> <Days> <Months> <Weekdays> <Years>

Example:

\ each Monday at 11:10
Time: 10 11 * * 1 *
\ at the beginning of every hour
Time: 0 * * * * *

Time: START-TIME

Use this word to start a task immediately after nnCron startup.

Example:

#( test_start_time
\ displaying a message immediately after nnCron is started
Time: START-TIME
Action:
    TMSG: "nnCron is up!" 3
)#

See also description of "nonstandard" character '?' in nnCron's cron format and START-TIME? word.


Minutes: <mm>
Hours: <hh>
Days: <DD>
Months: <months>
Weekdays: <week_days>
Years: <years>

If the majority of fields in the argument of Time: is filled with asterisks (*), it will be perhaps more convenient to use "verbal notation", where you specify only those fields which contain some numerical values and omit asterisks.

Examples:

\ the same as  'Time: 30 * * * * *'
Minutes: 30
\ the same as  'Time: 0 12 * * 6,7 *'
Minutes: 0
Hours: 12
Weekdays: 6,7

Please note that when you are using this type of notation you cannot use more than one time specification.

Examples:

\ one cannot use more than one time specification
\ when using "verbal notation"
Minutes: 0
Minutes: 30 \ error!
\ one cannot use more than one time specification 
\ when using "verbal notation"
Minutes: 0
Time: * 12 * * * * \ error!

See also: