I have been reading about people setting up a cron job to do fstrim on their SSDs on a daily/weekly basis.

So, here are my questions:

  1. Is it feasible to run cron if my laptop doesn’t have 100% uptime? As in, does it manage to run, for example, a weekly job if my computer is shut down at the start of its week and I then turn it on?
  2. Do I need to run fstrim? Duckduckgoing about it has left me a bit confused. Void Linux (the ditro I use) doesn’t do it by default I am sure.
  • @flux
    link
    34 years ago
    1. cron won’t do that. You can use anacron or systemd timers to handle those scenarios.
    2. Maybe. I believe fstrim can be—or used to be—nicer than filesystem options because trimming is/used to be an operation that didn’t queue properly, so doing it in bulk when you’re not using it can be better. But who knows, maybe this is better nowadays. I guess it can increase your chances of doing “recover removed files”-kind of operations successfully if you haven’t trimmed the device [automatically by the filesystem].