From 0976ce2f192b75a332813cb83239f523ef90954a Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 17 Jan 2013 20:38:01 +0100 Subject: [PATCH] fstrim: add daily cronjob. --- config/fstrim/trim | 8 ++++++++ config/rootfiles/common/fstrim | 1 + lfs/fstrim | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 config/fstrim/trim diff --git a/config/fstrim/trim b/config/fstrim/trim new file mode 100644 index 000000000..6f61a63bd --- /dev/null +++ b/config/fstrim/trim @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Script to trim free space on solid state drives. +# +for i in / /boot /var; do + fstrim $i 2>&1 >/dev/null +done + diff --git a/config/rootfiles/common/fstrim b/config/rootfiles/common/fstrim index 7fb97b0bb..775fa9286 100644 --- a/config/rootfiles/common/fstrim +++ b/config/rootfiles/common/fstrim @@ -1 +1,2 @@ +etc/fcron.daily/trim usr/bin/fstrim diff --git a/lfs/fstrim b/lfs/fstrim index 6886cc9f0..451af5ab3 100644 --- a/lfs/fstrim +++ b/lfs/fstrim @@ -72,5 +72,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) cd $(DIR_APP) && install -m 0755 fstrim /usr/bin + # Install cronjob + install -m 0755 $(DIR_SRC)/config/fstrim/trim /etc/fcron.daily @rm -rf $(DIR_APP) @$(POSTBUILD) -- 2.39.2