From c35d55f2d38bf2ce526f9d0985a4ebe78461897c Mon Sep 17 00:00:00 2001 From: z3rOR0ne Date: Sun, 5 Mar 2023 15:46:34 -0800 Subject: [PATCH] :sparkles: Added fstrim notify/script --- scripts/fstrim_notify.sh | 7 +++++++ scripts/trim | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100755 scripts/fstrim_notify.sh create mode 100755 scripts/trim diff --git a/scripts/fstrim_notify.sh b/scripts/fstrim_notify.sh new file mode 100755 index 00000000..3dac1a42 --- /dev/null +++ b/scripts/fstrim_notify.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# simple cron script to notify to possibly run trim script +LAST_UPDATE=$(cat "$HOME"/.fsdate) + +notify-send "fstrim alert!, last fstrim on: +${LAST_UPDATE}" diff --git a/scripts/trim b/scripts/trim new file mode 100755 index 00000000..74bb3975 --- /dev/null +++ b/scripts/trim @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# this script is meant to simply notify to fstrim +# it also updates a .fsdate file in $HOME with the date of the last fstrim + +# allows to overwrite .fsdate file +set +o noclobber + +doas fstrim --all --verbose --minimum 1048576 && +notify-send "  fstrim completed!!" + +date > "$HOME/.fsdate"