Answers:
要查看您的每周cron作业的详细信息,请将目录更改为/etc/cron.weekly
或将其包含在命令中,如下所示:
more /etc/cron.weekly/fstrim
您应该看到如下所示的输出:
#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true
如果存在,则修剪被激活/检查并每周执行一次。此命令的帮助将向您显示...
fstrim --help
Usage:
fstrim [options] <mount point>
Options:
-a, --all trim all mounted filesystems that are supported
-o, --offset <num> the offset in bytes to start discarding from
-l, --length <num> the number of bytes to discard
-m, --minimum <num> the minimum extent length to discard
-v, --verbose print number of discarded bytes
-h, --help display this help and exit
-V, --version output version information and exit
要查看是否支持修剪(如果有多个磁盘,请更改sda):
sudo hdparm -I /dev/sda | grep "TRIM supported"
并且应该显示类似以下内容:
* Data Set Management TRIM supported (limit 8 blocks)