Tell us about yourself!

Complete Your Profile
  • DarrenB35 commented on JaredT22's instructable Raspberry Pi Auto Update (Updated)9 days ago
    Raspberry Pi Auto Update (Updated)

    Thank you so much, JaredT22. I've been scouring the internet to figure out a way to get a Raspberry Pi with a media server to update automatically. This ended up being my starting point, but I tried this in Raspbian Stretch and had some serious problems getting the shell script to run. I'm brand new to Linux, so by no means am I an expert. Things may have changed between Jessie and Stretch (and will likely continue to change) but in figuring out how to get this to run properly, I ended up doing a lot of research across the web. This is what I found:1) The default shell in Stretch is bash, so the shebang at the first line of the shell script now needs to be #!/bin/bash.2) sudo rpi-update will pull buggy, experimental firmware onto the Raspberry Pi, so I took out that command altogether...

    see more »

    Thank you so much, JaredT22. I've been scouring the internet to figure out a way to get a Raspberry Pi with a media server to update automatically. This ended up being my starting point, but I tried this in Raspbian Stretch and had some serious problems getting the shell script to run. I'm brand new to Linux, so by no means am I an expert. Things may have changed between Jessie and Stretch (and will likely continue to change) but in figuring out how to get this to run properly, I ended up doing a lot of research across the web. This is what I found:1) The default shell in Stretch is bash, so the shebang at the first line of the shell script now needs to be #!/bin/bash.2) sudo rpi-update will pull buggy, experimental firmware onto the Raspberry Pi, so I took out that command altogether.3) For some reason, both the shell script and the log file that I created were owned by root. While I could have gotten around this problem by using sudo chown to change the owner, there was an easier way. cron has a user-specific version and a root version, so I activated the root cron using the command sudo crontab -e4) I wanted to separate and date each upgrade and include subheadings to allow for greater scrutiny of the log. There are also a few more steps in the update/upgrade/cleaning process that require the user to input a y/n choice, so my final shell script looked like this:#!/bin/bashecho "**********" >> /logs/crontab`date` >> /logs/crontabecho "UPDATING SYSTEM SOFTWARE - UPDATE" >> /logs/cronlogsudo apt-get updateecho "UPGRADING SYSTEM SOFTWARE -UPGRADE" >> /logs/cronlogsudo apt-get –y upgradeecho "UPGRADING SYSTEM SOFTWARE -DISTRIBUTION" >> /logs/cronlogsudo apt –y dist-upgradeecho "REMOVING OBSOLETEDEPENDENCIES" >> /logs/cronlogsudo apt-get –y autoremoveecho "REMOVING OBSOLETE FILES">> /logs/cronlogsudo apt-get autocleanecho "SYSTEM REBOOT" >> /logs/cronlogsudo rebootI hope this helps anyone who runs into the same difficulties that I did!

    View Instructable »