diff --git a/timeshift-autosnap b/timeshift-autosnap index 5d331c25833ac8d7cb9efe067bf787a403f9549d..e6a712e22d358b492f985bc2992db25df32aec99 100755 --- a/timeshift-autosnap +++ b/timeshift-autosnap @@ -1,8 +1,8 @@ #!/bin/bash #author: gobonja +#Modified by Matti Hyttinen [ $(findmnt / -no fstype) == "overlay" ] && { echo "==> skipping timeshift-autosnap because system is booted in Live CD mode..."; exit 0; } - [[ -v SKIP_AUTOSNAP ]] && { echo "==> skipping timeshift-autosnap due SKIP_AUTOSNAP environment variable being set."; exit 0; } readonly CONF_FILE=/etc/timeshift-autosnap.conf @@ -33,6 +33,10 @@ if $(get_property "skipAutosnap" "boolean" "false") ; then echo "==> skipping timeshift-autosnap due skipAutosnap in $CONF_FILE set to TRUE." >&2; exit 0; fi +if $(get_property "skipRsyncAutosnap" "boolean" "false") && ! [ $(findmnt / -no fstype) == "btrfs" ] ; then + echo "==> skipping timeshift-autosnap due skipRsyncAutosnap in $CONF_FILE set to TRUE." >&2; exit 0; +fi + readonly SNAPSHOT_DESCRIPTION=$(get_property "snapshotDescription" "string" "{timeshift-autosnap} {created before upgrade}") timeshift --create --comments "$SNAPSHOT_DESCRIPTION" || { echo "Unable to run timeshift-autosnap! Please close Timeshift and try again. Script will now exit..." >&2; exit 1; } diff --git a/timeshift-autosnap.conf b/timeshift-autosnap.conf index 10001a0e4a8038d83c3256aee647c3d2a97da91f..b00cde017f57d2e9f415f55ee5efcaa648e9d434 100644 --- a/timeshift-autosnap.conf +++ b/timeshift-autosnap.conf @@ -6,6 +6,10 @@ # Default value is false. skipAutosnap=false +# skipRsyncAutosnap defines if timeshift-autosnap execution should be skipped on filesystems other than btrfs. +# Default value is true. +skipRsyncAutosnap=true + # deleteSnapshots defines if old snapshots should be deleted. # Default value is true. deleteSnapshots=true