Fixed snapshot script

This commit is contained in:
Christoffer Martinsson 2024-11-26 22:09:26 +01:00
parent b6ff30b80c
commit aa317f774e

View File

@ -16,8 +16,14 @@ echo -e ' \e[H\e[2J
' '
# Create backup/snapshot # Create backup/snapshot
if pacman -Qs timeshift >/dev/null; then if pacman -Qs timeshift >/dev/null; then
printf -- '\033[33m Creating backup/snapshot\n\033[37m' CONFIG_FILE="/etc/timeshift/timeshift.json"
sudo timeshift --create --comments "Update script" --tags O 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 fi
# Update all pacman packages # Update all pacman packages