From ba966fdff88d15938920cc06441403fb420744f8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 17 Jul 2023 22:03:18 -0400 Subject: [PATCH] Update cron-update-lxcs.sh This script is designed to schedule a cron job that updates all LXCs every Sunday at midnight. --- misc/cron-update-lxcs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/cron-update-lxcs.sh b/misc/cron-update-lxcs.sh index 38ea40ca..1e9221a9 100644 --- a/misc/cron-update-lxcs.sh +++ b/misc/cron-update-lxcs.sh @@ -18,14 +18,14 @@ EOF add() { while true; do - read -p "This script will add a cron job to update all LXCs at midnight. Proceed(y/n)?" yn + read -p "This script will schedule a cron job that updates all LXCs every Sunday at midnight. Proceed(y/n)?" yn case $yn in [Yy]*) break ;; [Nn]*) exit ;; *) echo "Please answer yes or no." ;; esac done -sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * * PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -' +sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * 0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -' clear echo -e "\n To view Update LXCs Cron logs: cat /var/log/update-lxcs-cron.log" }