Written by marcelpetrick
on July 10, 2018
Logging in to the raspberry(ies) to update them on a regular basis takes time and effort. Both are currently dear.
Also: while the catcam is taking pictures, you can’t update the rpi-binaries.
So I made this nice script, which first suspends the catcam-operation while renaming the script from the cronjob, then does all updates, reverts the renaming and then reboots the MCU.
1 2 3 4 5 6 7 8 9 10 11 |
#!/usr/bin/env bash # author: Marcel Petrick (mail@marcelpetrick.it) mv /home/pi/Desktop/webcam/regulargif.sh /home/pi/Desktop/webcam/regulargif.sh1 sudo rpi-update sudo apt-fast update && sudo apt-fast dist-upgrade -y sudo apt-get autoclean sudo apt-get autoremove mv /home/pi/Desktop/webcam/regulargif.sh1 /home/pi/Desktop/webcam/regulargif.sh sudo reboot |
Make it executeable via ‘sudo chmod +X updateCatcam.sh’ and also add it as cronjob (once a day).