Skip to content

Instantly share code, notes, and snippets.

@ricco386
Created June 30, 2017 14:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricco386/b621f693129d337699125e407bdfd973 to your computer and use it in GitHub Desktop.
Save ricco386/b621f693129d337699125e407bdfd973 to your computer and use it in GitHub Desktop.
Systemd timer for fstrim. Usage: systemctl enable fstrim.timer
# /etc/systemd/system/fstrim.service
# Called by /usr/lib/systemd/system/fstrim.timer from util-linux
# Add `-v` flag so that results can be reviewed in jouranctl
[Unit]
Description=Discard unused blocks (for SSD Drives)
[Service]
Type=oneshot
ExecStart=/usr/sbin/fstrim -av
@attila123
Copy link

On Arch (at least installed by Antergos) the fstrim.service file is at /etc/systemd/system/fstrim.service, not as indicated in line 1, and already has this content (except that fstrim is located at /sbin/fstrim).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment