logic changes and cron changes

This commit is contained in:
allan 2025-03-25 12:30:08 +01:00
parent 8ba10c09e0
commit 8134890235
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ Ubuntu 22.04 or higher server.
> Update security packages\ > Update security packages\
> Remove unused depencies same as apt autoremove\ > Remove unused depencies same as apt autoremove\
> Reboot if needed even with users logged on\ > Reboot if needed even with users logged on\
> Create a crontab entry to run updates every Sunday at 04:00 > Create a crontab entry to run updates every Saturday at 04:00
### Download the script ### Download the script
``` ```

View File

@ -57,7 +57,7 @@ sed -i '/${distro_id}:${distro_codename}-updates/ s/^\/\///' /etc/apt/apt.conf.d
# || # ||
# Optional: Uncomment the next 2 lines for removal of unused packages this equals apt autoremove # Optional: Uncomment the next 2 lines for removal of unused packages this equals apt autoremove
# Optionnal: Comment out line 1 and 2 for reboot if needed and line 3 to rebbot with user logged in with a #. # Optionnal: Comment out line 1 and 2 for reboot if needed and line 3 to rebbot with user logged in.
# || # ||
# \/ # \/
sed -i '\/\/Unattended-Upgrade::Automatic-Reboot "false"/ s/^\/\///' /etc/apt/apt.conf.d/50unattended-upgrades sed -i '\/\/Unattended-Upgrade::Automatic-Reboot "false"/ s/^\/\///' /etc/apt/apt.conf.d/50unattended-upgrades
@ -69,7 +69,7 @@ sed -i '\/\/Unattended-Upgrade::Automatic-Reboot-WithUsers/ s/^\/\///' /etc/apt/
# #
# Create cronjob running every sunday at 04:00 # Create cronjob running every sunday at 04:00
# #
cronjob01="0 4 * * 7 root /usr/bin/apt update && /usr/bin/unattended-upgrade -v >/dev/null 2>&1" cronjob01="0 4 * * 6 root /usr/bin/apt update && /usr/bin/unattended-upgrade -v >/dev/null 2>&1"
echo "$cronjob01" > /etc/cron.d/updatesystem echo "$cronjob01" > /etc/cron.d/updatesystem
# #
# Restart unatended upgrades and cron. # Restart unatended upgrades and cron.