31,703
edits
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
The crontab can be opened for editing, adding, removing or modifying scheduled tasks. This article will provide an explanation of the crontab functionality principle and present some usage examples in hopes that it may help you configure your own crontab rules. | The crontab can be opened for editing, adding, removing or modifying scheduled tasks. This article will provide an explanation of the crontab functionality principle and present some usage examples in hopes that it may help you configure your own crontab rules. | ||
==Crontab syntax and editing== | ==Crontab syntax and editing overview== | ||
===Editing environment=== | ===Editing environment=== | ||
--- | ---- | ||
Firstly, you must decide on what environment you want to use for editing. Crontabs can be edited via a '''Command Line Interface''' ('''CLI'''). RUT routers offer a range of options in that regard. For example, you can use the CLI present in the router's WebUI ('''Services → CLI'''). Or you can log in via '''SSH''' and make edits from there. The method of logging in via SSH is different on different systems: on Linux systems you can use the '''Terminal''' app log in with the command '''''ssh root@<routers_lan_ip_address>'''''; on '''Windows''' systems you can use the free '''PuTTY''' client. | Firstly, you must decide on what environment you want to use for editing. Crontabs can be edited via a '''Command Line Interface''' ('''CLI'''). RUT routers offer a range of options in that regard. For example, you can use the CLI present in the router's WebUI ('''Services → CLI'''). Or you can log in via '''SSH''' and make edits from there. The method of logging in via SSH is different on different systems: on Linux systems you can use the '''Terminal''' app log in with the command '''''ssh root@<routers_lan_ip_address>'''''; on '''Windows''' systems you can use the free '''PuTTY''' client. | ||
Line 34: | Line 34: | ||
For the sake of example, I've added a Ping Reboot rule to the router's configuration. In the figure above you can see that creating such a rule also generates an entry (encapsulated in green) in the crontab list. Let's examine this entry: | For the sake of example, I've added a Ping Reboot rule to the router's configuration. In the figure above you can see that creating such a rule also generates an entry (encapsulated in green) in the crontab list. Let's examine this entry: | ||
* | * The '''/sbin/ping_reboot 1 8.8.8.8 NULL 2 56 5 1 0 cfg02c21d''' part indicates the action that is to be taken. In this case it is the ''/sbin/ping_reboot'' command with the options ''1 8.8.8.8 NULL 2 56 5 1 0 cfg02c21d'' that go with it | ||
* | * The '''*/5 * * * *''' part indicates the frequency at which the action is executed. It consists out of five segments: '''minute''', '''hour''', '''day of the month''', '''month''' and '''day of the week''' in that order. A table of examples on how to specify this frequency is presented below: | ||
* | |||
min hour day/month month day/week Description | min hour day/month month day/week Description |