From aa317f774e2be45b93376cd1c48b7e33a890e03e Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 26 Nov 2024 22:09:26 +0100 Subject: [PATCH] Fixed snapshot script --- update_arch.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/update_arch.sh b/update_arch.sh index 768fe3f..6e08339 100755 --- a/update_arch.sh +++ b/update_arch.sh @@ -16,8 +16,14 @@ echo -e ' \e[H\e[2J ' # Create backup/snapshot if pacman -Qs timeshift >/dev/null; then - printf -- '\033[33m Creating backup/snapshot\n\033[37m' - sudo timeshift --create --comments "Update script" --tags O + CONFIG_FILE="/etc/timeshift/timeshift.json" + if [ -f "$CONFIG_FILE" ]; then + BTRFS_MODE=$(jq '.btrfs_mode' "$CONFIG_FILE") + if [ "$BTRFS_MODE" == '"true"' ]; then + printf -- '\033[33m Creating backup/snapshot\n\033[37m' + sudo timeshift --create --comments "Update script" + fi + fi fi # Update all pacman packages