Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Scheduler ====== crond scans the CRONTAB file every minute and checks every line to determine if the specified time/date information matches the current time/date. If they are equal, the command line specified will be executed. Enabling [[wp>cron]] can be done via web interface via the Admin>Services tab. {{:livebox:cron-webservice.jpg|}} Toggling this radio button will change the following configuration entry in ''/etc/xap-livebox.ini'' with 1 being enabled and missing or 0 being disabled. <code> [cron] enable=1 </code> ===== Timezones ===== <note>This section might need amending when we enter daylight savings as it's a little tricky to test as of the time of writing.</note> To make sure you are running cron in the right timezone you'll need to setup the /etc/TZ file. <code> # echo GMT0BST-1 >/etc/TZ </code> If you are on the EAST coast of the US you would use <code> # echo EST5EDT4 >/etc/TZ </code> See for more examples http://wiki.openwrt.org/doc/uci/system ===== crontabs ===== You create and configure your ''crontab'' entries by using the ''crontab'' command line program. The command "crontab -e" will open the editor vi by default. <code> # crontab BusyBox v1.12.1 (2011-11-30 14:38:56 EST) multi-call binary Usage: crontab [-c DIR] [-u USER] [-ler]|[FILE] -c Crontab directory -u User -l List crontab -e Edit crontab -r Delete crontab FILE Replace crontab by FILE ('-': stdin) </code> They will be created and stored in ''/etc/crontabs'' if you wish to back them up. There are several helper scripts that allow you to send xAP messages. * ''bscmsg'' - will send an xAPBSC.cmd message * ''aliasmsg'' - will send a ''class=alias'' payload in keeping with ''xap-googlecal'' and ''xap-twitter'' behaviour. This can be in turn processed by an alias Lua [[hah_plugboard_v2|plugboard]] applet. Both of these scripts are written in Lua and are installed into ''/usr/bin'' on your system, so you can browse the source and use them as starters for your own scripts. For example ''aliasmsg'' will send this message with %s being substituted for the argument you supply to the script. <code> xap-header { class=alias } command { text=%s } </code> A sample crontab might look like. Using ''bscmsg'' we are turning an RF unit On at 7:00am and Off an 7:01am, transposing this to 8am and using the ''aliasmsg'' script we can do a similar thing. <code> 0 7 * * * bscmsg -t dbzoo.livebox.controller:rf.1 -s on 1 7 * * * bscmsg -t dbzoo.livebox.controller:rf.1 -s off 0 8 * * * aliasmsg "rf 1 on" 1 8 * * * aliasmsg "rf 1 off" </code> Want to wake a machine using Wake-on-LAN? This entry would send a WoL packet to the specified MAC address at 7am Mon-Fri. <code> 0 7 * * 1-5 ether-wake -i br0 3c:d9:2b:5b:67:c2 </code> The helper scripts can be run from the command line to test that you have got the correct syntax before putting this same command line string into a [[wp>crontab]]. <code> # bscmsg bscmsg:missing required parameter: t Various flags and option types -t (string) xAPBSC Target -s (onoff) xAPBSC State -x xAPBSC Text -l xAPBSC Level # </code> Kinda obvious, but when testing, be sure to check that the date on your Livebox is correctly set. At the command prompt 'date' will show you the current date/time. {{tag>livebox}} livebox/scheduler.txt Last modified: 2013/10/20 16:40by minerva9