diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..275c9d7191cfc737d211d21ef359901d34006e9d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +\.directory + +aur/ diff --git a/README.md b/README.md index d4517dfa313ccae7349b43ea5f7fb7c65eb24713..c8b46468cb3b25d26cfd7bb8f9f4cb41551b1152 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Timeshift auto-snapshot script which runs before package upgrade using Pacman ho * Can be manually executed by running `timeshift-autosnap` command with elevated privileges. # /etc/timeshift-autosnap.conf options: -* `skipAutosnap` - if set to **false** script won't be executed. +* `skipAutosnap` - if set to **true** script won't be executed. * `deleteSnapshots` - if set to **false** old snapshots won't be deleted. * `maxSnapshots` - defines **maximum** number of old snapshots to keep. * `updateGrub` - if set to **false** grub entries won't be generated. @@ -18,4 +18,4 @@ Timeshift auto-snapshot script which runs before package upgrade using Pacman ho * This script is made in Arch and Arch based distros in mind but if there would be interest it should be easily ported to other distros. # Contribution -* All new ideas and contributors are welcomed! \ No newline at end of file +* All new ideas and contributors are welcomed! diff --git a/timeshift-autosnap b/timeshift-autosnap index e1e5a667b0cdd70a33272cbadfc1f0031954b0ff..3305cb16fc02049dc9be4810d44595660707a586 100755 --- a/timeshift-autosnap +++ b/timeshift-autosnap @@ -1,6 +1,10 @@ #!/bin/bash #author: gobonja +if [ $(findmnt / -no fstype) == "overlay" ] ; then + echo "==> skipping timeshift-autosnap because system is booted in Live CD mode..."; exit 0; +fi + readonly CONF_FILE=/etc/timeshift-autosnap.conf readonly SNAPSHOTS_TO_DELETE=/tmp/timeshift-autosnap-tmp @@ -29,7 +33,7 @@ if $(get_property "skipAutosnap" "boolean" "false") ; then echo "==> skipping timeshift-autosnap due skipAutosnap in $CONF_FILE set to TRUE." >&2; exit 0; fi -timeshift --create --comments "$SNAPSHOT_DESCRIPTION" || { echo "Please close Timeshift and try again. Script will now exit..." >&2; exit 1; } +timeshift --create --comments "$SNAPSHOT_DESCRIPTION" || { echo "Unable to run timeshift-autosnap! Please close Timeshift and try again. Script will now exit..." >&2; exit 1; } if $(get_property "deleteSnapshots" "boolean" "true") ; then timeshift --list > $SNAPSHOTS_TO_DELETE @@ -51,4 +55,4 @@ if $(get_property "updateGrub" "boolean" "true") && [ "$(pacman -Qs ^grub-btrfs$ grub-mkconfig -o /boot/grub/grub.cfg fi; -exit 0 \ No newline at end of file +exit 0