Update Raspberry Pi on Schedule

open up an SSH shell

sudo nano update.sh


enter the following

#!/bin/sh

sudo apt-get update && sudo apt-get upgrade -y

sudo rpi-update

sudo apt-get autoremove

sudo apt-get autoclean

sudo reboot

then ctrl + x, y and enter when done


Make the file executable

sudo chmod +x update.sh

type crontab -e and select the second option

To the bottom of the file add

0 0 * * SAT sh /home/pi/update.sh

then ctrl + x, y and enter when done