#!/bin/bash


echo "=== attempting automatic daily update on $(date '+%Y-%m-%d-%H:%M:%S') ===" | tee -a /scripts/update.sh.log

# apt update 2>&1 | tee -a /scripts/update.sh.log
# apt -y upgrade 2>&1 | tee -a /scripts/update.sh.log

# echo "=== automatically removing un-needed packages (and old kernels) ==="
# keeping too many old kernel versions might fill up boot partition
# apt -y autoremove | tee -a /scripts/update.sh.log

# echo "=== fine ===" | tee -a /scripts/update.sh.log
# echo "" | tee -a /scripts/update.sh.log

apt update
apt -y upgrade
apt -y autoremove

echo "=== fine ===" | tee -a /scripts/update.sh.log
echo "" | tee -a /scripts/update.sh.log
