From 0c6449302ea962101771b174aedbf003e1a22c4d Mon Sep 17 00:00:00 2001 From: Carlos Sousa Date: Thu, 13 Mar 2025 10:47:43 +0100 Subject: [PATCH] add timeshift snapshot to update&shutdown --- bashScripts/update_and_shutdown_fedora.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bashScripts/update_and_shutdown_fedora.sh b/bashScripts/update_and_shutdown_fedora.sh index cf8e3983..10650680 100644 --- a/bashScripts/update_and_shutdown_fedora.sh +++ b/bashScripts/update_and_shutdown_fedora.sh @@ -22,6 +22,25 @@ echo "" echo "sudo permissions available. Starting" echo "" + +if which "timeshift" &> /dev/null; then + echo "" + echo "Making snapshot with timeshift" + echo "" + sudo timeshift --create --comments "Pre Updates" +else + echo "" + echo "timeshift is not installed." + echo "continuining without making a snapshot" + echo "" +fi + + +echo "" +echo "Starting Updates" +echo "" + +sudo dnf clean all -y sudo dnf check -y sudo dnf check-update -y sudo dnf update -y @@ -29,11 +48,10 @@ sudo flatpak update -y sudo flatpak repair sudo flatpak uninstall --unused -y sudo dnf autoremove -y -sudo dnf clean all -y echo "" -echo "Press any key withing $SHUTDOWN_TIMEOUT seconds to cancel shutdown." +echo "Press any key within $SHUTDOWN_TIMEOUT seconds to cancel shutdown." echo "" if read -t $SHUTDOWN_TIMEOUT -n 1; then