User Tools

Site Tools


cammos-rpi-displays

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
cammos-rpi-displays [2015/06/09 11:02] – [VNC instructions] snargcammos-rpi-displays [2015/06/22 11:57] (current) snarg
Line 160: Line 160:
   - Save and exit.   - Save and exit.
   - Reboot and test.   - Reboot and test.
 +
 +==== How to run a cron job every 5 minutes ====
 +
 +
 +To edit the crontab, use the command <code>crontab -e</code> This uses the editor specified in the environment variable$EDITOR, and if the variable is empty, this defaults to nano
 +
 +The format of a crontab is 6 columns, space (or tab) separated. The first 5 columns detail the time when to run a command, which is specified in the last column. The last "column" makes up all the remaining characters, inclusive of spaces. Here is an example:
 +<code>5 * * * * /home/aspera/my_script.sh</code>
 +
 +What the above shows, per column:
 +  - Minute to run on, a value of 0-59: 5 means on the 5th minute of the hour
 +  - The Hour, a value of 0-23: * means every hour
 +  - Day of the Month, 1-31: * means every day of the month
 +  - The Month, 1-12: * means every month
 +  - Day of the Week, 0-7 (0 and 7 are both Sunday): * means every day
 +  - The Command: In this case, a command at /home/aspera/my_script.sh
 +
 +With older crontabs, like the one on legacy Solaris, this is mostly all that can be done. One variation is to use comma separated lists. Modern crontabs can use string names for days, and wildcards with increments. So, to create an entry that runsmy_script.sh every 5 minutes would be as follows on Linux:
 +<code>*/5 * * * * sudo mount -a</code>
 +
 +The */5 notation in the first column means "every 5 minutes". To make this every 10 minutes, */10 is used.
 +
 +==== Remotely checking to see what screen connector is active ====
 +
 +the command to see the status of displays and resolution in Xorg is "xrandr". Remoting in with vnc or on the device itself, xrandr by itself will be enough. From an ssh session xrandr needs to know which display server to query, as the shell isnt a child of the Xorg process:
 +<code>DISPLAY=:0.0 xrandr</code>
  
cammos-rpi-displays.txt · Last modified: 2015/06/22 11:57 by snarg