Skip to content

Instantly share code, notes, and snippets.

@pelsedyr
Last active August 29, 2015 14:13
Show Gist options
  • Save pelsedyr/6d39f7d7481859fd524f to your computer and use it in GitHub Desktop.
Save pelsedyr/6d39f7d7481859fd524f to your computer and use it in GitHub Desktop.
A Cron script that invokes daily run of fstrim and writes out results to a log.
#!/bin/sh
#Egen script for å kjøre fstrim og skrive ut resultatet til en log
LOG=/var/log/trim.log
echo "Starting trim $(date -R) " >> $LOG
fstrim -v / >> $LOG
fstrim -v /home >> $LOG
fstrim -v /boot >> $LOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment