Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


pc_engines_apu_centos_7

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
pc_engines_apu_centos_7 [2014/12/27 13:17] – [Preparation] adminpc_engines_apu_centos_7 [2014/12/27 13:34] – [Preparation] admin
Line 91: Line 91:
 # Mount /tmp as tmpfs. # Mount /tmp as tmpfs.
 echo "tmpfs /tmp tmpfs size=64m 0 0" >> /etc/fstab echo "tmpfs /tmp tmpfs size=64m 0 0" >> /etc/fstab
 +
 +#Add weekly fstrim job
 +cat << EOF >  /etc/cron.weekly/fstrim
 +#!/bin/sh
 +#this script will run weekly, will overwrite log.
 +
 +trimlog=/var/log/fstrim.log
 +echo > \$trimlog
 +for mount in \`lsblk -ro "rota,rm,fstype,mountpoint" | egrep "0 0 ext[2|3|4]" | cut -d " " -f4\`; do
 +  printf "\`date\` - \`fstrim -v \$mount\`\n" >>\$trimlog
 +done
 +EOF
 +chmod +x /etc/cron.weekly/fstrim
  
 # Enable LVM to issue discards. # Enable LVM to issue discards.
pc_engines_apu_centos_7.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1