]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
fstrim: add daily cronjob.
authorArne Fitzenreiter <Arne_F@ipfire.org>
Thu, 17 Jan 2013 19:38:01 +0000 (20:38 +0100)
committerArne Fitzenreiter <Arne_F@ipfire.org>
Thu, 17 Jan 2013 19:38:01 +0000 (20:38 +0100)
config/fstrim/trim [new file with mode: 0644]
config/rootfiles/common/fstrim
lfs/fstrim

diff --git a/config/fstrim/trim b/config/fstrim/trim
new file mode 100644 (file)
index 0000000..6f61a63
--- /dev/null
@@ -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
+
index 7fb97b0bb4c4c763c25f729bef98265b98f122d9..775fa92864aa5e96599502880621b3ca19446c8d 100644 (file)
@@ -1 +1,2 @@
+etc/fcron.daily/trim
 usr/bin/fstrim
index 6886cc9f02993eac5d9a362bbbd7cb57d2ddedcb..451af5ab3a6af1ec895951d4e97a5faa1d95043b 100644 (file)
@@ -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)