From 281f0be34a6ba6f0f7a6391cf0fbdc9654418b10 Mon Sep 17 00:00:00 2001 From: WickedYoda <68271168+wickedyoda@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:12:32 -0500 Subject: [PATCH] Update echo line --- ubuntu-debian-based/setup_cron_job_updates.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ubuntu-debian-based/setup_cron_job_updates.sh b/ubuntu-debian-based/setup_cron_job_updates.sh index b7e5ed6..2148c05 100644 --- a/ubuntu-debian-based/setup_cron_job_updates.sh +++ b/ubuntu-debian-based/setup_cron_job_updates.sh @@ -15,8 +15,13 @@ sudo systemctl start cron sudo systemctl stop cron # Add the update and upgrade cron job to /etc/cron.d/ -echo 'MAILTO="alerts@tyates.one" -0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y' | sudo tee /etc/cron.d/auto_updates +# Old line that doesnt work +# echo 'MAILTO="alerts@tyates.one" +# 0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y' | sudo tee /etc/cron.d/auto_updates + +# Added new line to test. +echo '0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y' | sudo tee -a /etc/crontab + # Restart the cron service to apply the new cron job sudo systemctl start cron