Raspberry Pi – adding a cron job to run get_iplayer automatically

Finally getting round to automating my get_iplayer on my pi PVR with cron.

First find where your get_player PVR runs from by typing the following into the terminal

echo $PATH get_iplayer --pvr
my output was: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games get_iplayer --pvr

I had previously tried using:

cd ~/get_iplayer; ./get_iplayer –pvr

but this failed to work, so I recommend the echo path output string.

Next to write the cron job (adding the output file log location)

* 2,14 * * * PATH=./usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games get_iplayer --pvr  >>/home/pi/cron_log.txt

The 2,14 refers to 2am and 2pm, so the command will run at these times. See this wikipedia entry for further explanation and examples. Also note the “.” after the “=” this is required. The second part refers to the process you want to run (eg: run the PVR) and finally the “>” is where to save the output log to.

So now to add the cron job, open the terminal and type

crontab -e

The nano text editor should then open, the just add the line above to automate the PVR and save the output to /home/pi/cron_log.txt so you can check to see that everything is working as expected as the terminal window will not show the processes running. The double “>>” will ensure the new programmes are apended to the file rather than overwriting the file each time the process is run.

Now wait for 2am or 2am and check the log (alternatively set the time for a few minutes in the future to check its all working).

My previous post about get_iplayer here

More info about get_iplayer available on Square Penguin

 

 

Building an Ubuntu PC

I wanted to build my own pc and run linux that I have used on an HTPC for some time. This will be a cheap way into PC building and hopefully provide a good general use machine.

Kit List

  1. Case – NZXT source 210
  2. CPU – Intel Pentium Dual Core 2.8ghz
  3. Motherboard – with HDMI and DVI- Gigabyte B75
  4. RAM – 8GB Corsair 1600mhz (will run slower due to CPU)
  5. SSD – OCZ Agility 4 128GB
  6. HDD – WD Green 1tb from old external drive  (not yet fitted)
  7. USB Stick – for installing Ubuntu
  8. PSU – 80%+ – Antec High Current Gamer 400w – to be replaced by Bequiet 430w
  9. Speakers – Logitech x120
  10. Keyboard and mouse – have already
  11. Monitor – Dell 21” – have already
  12. 3.5” to 2.5” drive convertor – For SSD installing in a standard drive bay
  13. Optical Drive – Not needed this is 2012
  14. SATA cables

Continue reading