From f570ef6daced061fcd78b4fd4e4cf45e2c55937c Mon Sep 17 00:00:00 2001 From: David Scott Date: Tue, 6 Dec 2016 11:58:32 +0000 Subject: [PATCH] Use TRIM on Mac as well as Windows Previously we only ran `fstrim` on Windows. Docker for Mac now supports TRIM so we should run `fstrim` there too. Note it's possible to turn off TRIM on the Mac at the virtual hardware level via the database, but this should be harmless -- the `fstrim` fails immediately with an obvious error if the device doesn't support it: `fstrim: ioctl 0xc0185879 failed: Not supported`. Signed-off-by: David Scott --- alpine/etc/periodic/15m/trim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/alpine/etc/periodic/15m/trim b/alpine/etc/periodic/15m/trim index 415b91d1b..465f6d0b4 100755 --- a/alpine/etc/periodic/15m/trim +++ b/alpine/etc/periodic/15m/trim @@ -1,4 +1,8 @@ #!/bin/sh -# Windows always has TRIM support, clean out unused frequently -[ "$(mobyplatform)" = "windows" ] && /sbin/fstrim /var +# Windows and Mac have TRIM support, clean out unused frequently +case "$(mobyplatform)" in + "windows"|"mac") + /sbin/fstrim /var + ;; +esac