Skip to content
Snippets Groups Projects
Commit ab06ec8c authored by Matti Hyttinen's avatar Matti Hyttinen
Browse files

Add support to ignoring snapshots on filesystems other than btrfs

parent 37c78974
Branches dev
No related tags found
1 merge request!1Merge dev into master
#!/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; }
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment