Question: Currently, to get things up to date on my Raspberry Pi, I have to type in `sudo apt-get update` and `sudo apt-get upgrade`. Is there a way to set it up to automatically do this? I am running Raspbian Jessie.

Answer: 
Instead of a manual cron, you can install [`unattended-upgrades`](https://wiki.debian.org/UnattendedUpgrades), which is useful to ensure the latest kernels are installed. It's mostly designed for security.

```
apt-get install unattended-upgrades

```

There are some bits that can be adjusted/configured, but the default is fine.
Tasks can be automated using the cron utility.

To setup cron to update apt, in a terminal type:

```
sudo su

```

to access a root-level prompt. Then, run:

```
crontab -e

```

to begin editing your crontab, a table of tasks to run automatically at a given time. It will open in your preferred text editor. Modify it to include the following line:

```
0 7 * * 1 apt update && apt upgrade -y

```

This will tell the system to automatically update and upgrade your apps at 7AM every Monday. After saving and exiting, it is now activated, no further actions. Read-up on crontab to see how to adjust to your liking.

Note time trigger "0 7 \* \* 1" translates to 0 hours past 7 every day of every month that is a Monday. To help with changing the trigger, you can use <https://cron.help>.