diff --git a/setup_cron_job_updates.sh b/setup_cron_job_updates.sh index 47c0ae9..b7e5ed6 100644 --- a/setup_cron_job_updates.sh +++ b/setup_cron_job_updates.sh @@ -1,9 +1,22 @@ +#!/bin/bash + +# Script: setup_auto_updates.sh +# Description: Script to set up automatic system updates using cron + +# Update package lists and install cron sudo apt update -sudo apt install cron cron-apt -y +sudo apt install cron -y + +# Enable and start the cron service sudo systemctl enable cron +sudo systemctl start cron + +# Stop the cron service to make changes sudo systemctl stop cron -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" >> /etc/crontab +# 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 -sudo systemctl start cron \ No newline at end of file +# Restart the cron service to apply the new cron job +sudo systemctl start cron diff --git a/dockercompose_install.sh b/ubuntu-debian-based/dockercompose_install.sh similarity index 100% rename from dockercompose_install.sh rename to ubuntu-debian-based/dockercompose_install.sh diff --git a/ubuntu/ubuntu_install_apps.sh b/ubuntu-debian-based/ubuntu_install_apps.sh similarity index 100% rename from ubuntu/ubuntu_install_apps.sh rename to ubuntu-debian-based/ubuntu_install_apps.sh