Question about cron and SSDs?

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
31Y
  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].
@ksynwa
creator
link
11Y

Based. Thanks a lot. Another alternative is snooze (Github link).

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

  • 0 users online
  • 25 users / day
  • 56 users / week
  • 160 users / month
  • 424 users / 6 months
  • 4.43K subscribers
  • 1.58K Posts
  • 4.81K Comments
  • Modlog