Enabling daily trim in LM 18.3

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Mudskipper
Level 1
Level 1
Posts: 16
Joined: Sun May 05, 2019 5:50 pm

Enabling daily trim in LM 18.3

Post by Mudskipper » Wed May 15, 2019 4:16 pm

I've tried enabling daily trim as suggested in this guide.

However when I want to check I get

Code: Select all

systemctl cat fstrim.timer
No files found for fstrim.timer
So I guess it isn't donw the same way as in 19.1.

I did find the fstrim executable in cron.weekly. It's seems it's enabled but perfermed weekly.

Can I just move it to cron.daily to get trim to be performed daily?

lordmax
Level 3
Level 3
Posts: 110
Joined: Sun Jun 05, 2011 5:38 am
Location: Turin, Italy
Contact:

Re: Enabling daily trim in LM 18.3

Post by lordmax » Thu May 16, 2019 11:08 pm

Hi,

Basically yes.

Read this article that's really simple:
https://tecadmin.net/crontab-in-linux-w ... -schedule/

open crontab:

Code: Select all

crontab -e
It's just a vi

Search where it's the line you want to change and change it putting a @daily in place of @weekly
so, if something go wrong you can return to the weekly setting easily

DAMIEN1307
Level 7
Level 7
Posts: 1791
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

Re: Enabling daily trim in LM 18.3

Post by DAMIEN1307 » Fri May 17, 2019 12:28 am

first of all, copy and paste the following to see what timers are running and if trim in particular is running...you will need to expand the terminal to full screen to read it properly.

Check Timers

Code: Select all

systemctl list-timers
next, check just for trim running and how often.

Check if TRIM Timer is Running

Code: Select all

journalctl | grep fstrim
and lastly but not least, it really isnt necessary to run it daily but let it do its thing the way it was designed to...if you have altered settings already, you can correct it to the way it was designed by running this code.

Start Auto SSD TRIM

Code: Select all

sudo systemctl enable fstrim.timer && sudo systemctl start fstrim.timer
PS...you can run it manually at anytime by using this code...DAMIEN

Manual SSD TRIM

Code: Select all

sudo fstrim -av
ORDO AB CHAO

User avatar
smurphos
Level 11
Level 11
Posts: 3716
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher
Contact:

Re: Enabling daily trim in LM 18.3

Post by smurphos » Sun May 19, 2019 2:16 am

Mudskipper wrote:
Wed May 15, 2019 4:16 pm
Can I just move it to cron.daily to get trim to be performed daily?
Yes in 18.x just do...

Code: Select all

sudo mv /etc/cron.weekly/fstrim /etc/cron.daily/
There is no systemd fstrim timer service in 18.x and there isn't a job in your user crontab to edit so I'm not sure what the previous two respondents were getting at...
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.

DAMIEN1307
Level 7
Level 7
Posts: 1791
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

Re: Enabling daily trim in LM 18.3

Post by DAMIEN1307 » Sun May 19, 2019 8:08 am

My bad on that one smurphos...i totally vegged out on the fact that systemd is not present for fstrim timer on LM 18.xx 16.04 systems...the terminal codes i gave only work with LM19.1 of other 18.04 Ubuntu based systems...DAMIEN
ORDO AB CHAO

Mudskipper
Level 1
Level 1
Posts: 16
Joined: Sun May 05, 2019 5:50 pm

Re: Enabling daily trim in LM 18.3

Post by Mudskipper » Tue May 21, 2019 3:30 pm

Thanks smurphos!

Post Reply

Return to “Newbie Questions”