User Tools

Site Tools


doc:howto:notuci.config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:notuci.config [2013/05/02 12:03]
ponschab Fixed which files are kept by default
doc:howto:notuci.config [2015/03/07 00:26] (current)
pier4r crontab comment
Line 1: Line 1:
 ====== NotUCI Configuration ====== ====== NotUCI Configuration ======
-Most stuff can (and therefore should be) configured with [[doc:uci]]. This page concerns itself with the little stuff, ​that cannot be done with UCI. Users experienced with GNU/Linux distribution will know all of this by heart. For beginners this should be useful.+A lot of stuff can (and therefore should be) configured with [[doc:UCI]] via any of its interfaces. This page concerns itself with everything built into OpenWrt ​that cannot be configured ​with UCI. Note that most third party applications,​ installed with [[doc:​techref:​opkg|opkg]] or otherwise, typically also have their own configuration methods. Users experienced with GNU/Linux distribution will know all of this by heart. For beginners this should be useful.
  
  
Line 24: Line 24:
 </​code>​ | </​code>​ |
  
-===== /​etc/​crontabs/​root =====+===== /​etc/​crontabs/​root ​(cronjob aka crontab) ​=====
 Start and enable cron: Start and enable cron:
 <code bash> <code bash>
 sh /​etc/​init.d/​cron start sh /​etc/​init.d/​cron start
 sh /​etc/​init.d/​cron enable sh /​etc/​init.d/​cron enable
 +</​code>​
 +You might have to create the spool directory first, depending on openwrt version:
 +  mkdir -p /​var/​spool/​cron
 +
 +You can edit the current config with:
 +<code bash> ​
 +crontab -e 
 </​code>​ </​code>​
  
Line 47: Line 54:
 #min hour day month dayofweek command #min hour day month dayofweek command
 59 05 * * 1 /​usr/​bin/​wol -h 192.168.1.255 xx:​xx:​xx:​xx:​xx:​xx # Mo 59 05 * * 1 /​usr/​bin/​wol -h 192.168.1.255 xx:​xx:​xx:​xx:​xx:​xx # Mo
-#​crontab ​muss (wie fstab) ​in leerzeile oder kommentar enden+#​crontab ​must (as fstab) ​end with the last line as space or a comment
 </​code>​ </​code>​
  
Line 55: Line 62:
  
 **''​Note1:''​** On many platforms ''​shutdown''​ does not work; it will just halt the CPU but it won't power off the device. There is usually no programmable circuitry to actually power off the unit. ''​reboot''​ does work, in case you should want to reboot the router periodically. **''​Note1:''​** On many platforms ''​shutdown''​ does not work; it will just halt the CPU but it won't power off the device. There is usually no programmable circuitry to actually power off the unit. ''​reboot''​ does work, in case you should want to reboot the router periodically.
 +
 +**''​Note2:''​** Regarding ''​reboot''​ via cron:  The router has usually no real-time clock. In the boot process the clock is initially set by ''​sysfixtime''​ to the most recent timestamp of any file found in /etc. The most recent file is possibly a status file or config file, modified maybe 30 seconds before the reboot initiated by cron. So, in the boot process the clock gets set backwards a few seconds to that file's timestamp. Then cron starts and notices a few seconds later that the required boot moment has again arrived and reboots again... (At the end of the boot process ntpd starts, and it may also take a while before ntpd gets and sets the correct time, so cron may start the reboot in between.) One solution for cron is to use a delay and touch a file in /etc before reboot:
 +<​code>​
 +# Reboot at 4:30am every day
 +# Note: To avoid infinite reboot loop, wait 70 seconds
 +# and touch a file in /etc so clock will be set
 +# properly to 4:31 on reboot before cron starts.
 +30 4 * * * sleep 70 && touch /etc/banner && reboot
 +</​code>​
  
 ===== /​etc/​iproute2/​rt_tables ===== ===== /​etc/​iproute2/​rt_tables =====
Line 160: Line 176:
  
 ===== /​etc/​inittab ===== ===== /​etc/​inittab =====
-[[http://​linux.die.net/​man/​5/​inittab]]+<del>[[http://​linux.die.net/​man/​5/​inittab]]</​del>​ 
 +[[http://​man.cx/​inittab%284%29]] - not completely correct, but better
 <​code>​ <​code>​
 ::​sysinit:/​etc/​init.d/​rcS S boot ::​sysinit:/​etc/​init.d/​rcS S boot
doc/howto/notuci.config.1367488993.txt.bz2 · Last modified: 2013/05/02 12:03 by ponschab