Sample Header Ad - 728x90

Why is this update script not executing from cron?

1 vote
3 answers
2046 views
I simply want a script that runs a few update commands. I want them to happen at 3am every day. I cannot figure out why they don't work. I added this like to crontab -e 0 3 * * * root /etc/cron.custom/update The script in the update file is #!/bin/bash # if not root, run as root if (( $EUID != 0 )); then sudo /home/jb/bash/update.sh exit fi apt-get update dietpi-update apt-get -y upgrade apt-get -y dist-upgrade apt-get clean apt-get -y autoremove reboot I don't know how to make scripts so I found that off the internet. It is surprisingly hard to find any answers on how to edit anything to do with cron. Unattended upgrades doesn't upgrade everything so before anyone recommends it I tried it already and it missed heaps constantly. In short how do I auto update and upgrade my device? Running Debian (DietPi).
Asked by Ashley Forrest (11 rep)
Mar 16, 2017, 05:24 AM
Last activity: Jun 10, 2025, 10:03 AM