After my little rant about SSD TRIM in Linux Lite 3.x Series the other day, I put some energy towards finding a better solution to help users configure SSD trimming with easy today. I started coding what I thought it would be a Lite Tweak at some point (assuming it would’ve been approved and committed) but in the process I also realized that there is no Schedule Task tool in Linux Lite and that’s what’s really needed in my opinion!

Terminal and nano is certainly not a pleasant experience for those joining in for the first time. But what if there was a Scheduled Task tool in Linux Lite? It would allow new users to schedule SSDs trimming from GUI, it could allow regular users (non admins) to also schedule their own tasks with easy, or it could be used to change Lite Updates Notify frequency for those users who find the default options somewhat insufficient… to mention a few examples. No need to reinvent the wheel; gnome-schedule to the rescue!

gnome-schedule is not in the official Ubuntu repositories for Ubuntu 16.04. The last version there is for Ubuntu 13.10 and doesn’t seem to play nice in Ubuntu 16.04. Therefore, I compiled from sources the.deb packages below to save us some trouble and headaches with dependencies and the such. If you feel comfortable compiling your own package head over to SourceForge and get your hands on the latest version (2.3.0 as of this post).

My packages – from Terminal

Add Unlockforus repository to if you haven’t done so yet:

~$ echo "deb https://cdn.unlockforus.com/repository/dists/xenial/ /" | sudo tee /etc/apt/sources.list.d/unlockforus-xenial.list
# And add the PGP key:
~$ curl -s https://cdn.unlockforus.com/repository/keyFile | sudo apt-key add -

Install gnome-schedule:

~$ sudo apt-get update && sudo apt-get install gnome-schedule -y

Buy Ralpy a coffee :)

These packages include an additional application shortcut for admins Scheduled Tasks in addition to the default one. I modified the source to help differentiate between the regular users interface and the admin interface, which requires launching the application with elevated privileges and that isn’t obvious by default.

Scheduled tasks - admin
Scheduled tasks – admin
Scheduled tasks - users
Scheduled tasks – users
Whisker Menu
Whisker Menu

Let’s now enable daily TRIM with the newly installed Scheduled Tasks application…

Enabling Daily TRIM with Scheduled Tasks

Open Menu => System => Scheduled Tasks – admin and create a scheduled task to trim all mounted file systems which supports it:

ssd-trim-scheduled-task

Feel free to decide whether to create multiple tasks with multiple schedules for each mount point you want trimmed in your system or create a single task to trim them all as shown below.

Description: SSD TRIM
Command: (all in one line)

"$(command -v bash)" -c 'echo "*** $(date -R) ***"; ionice -c2 -n7 nice -n 19 /sbin/fstrim -v -a; echo " "' >> /var/log/trim.log

Time & Date – Advanced: Choose your schedule – Daily at 10:00am in this example:

scheduled-task-ssd-trim

Linux Lite will then trim your SSD mounts as per your own schedule and no dependencies on boot ups :)

Last but not least, disable the weekly fstrim under /etc/cron.weekly/ shipped by default – I wouldn’t personally bother but then again, it is single command:

From Terminal:

sudo mv /etc/cron.weekly/fstrim /

Check the trim.log file for the above scheduled task ( /var/log/trim.log ) after it has ran at least once:

~$ cat /var/log/trim.log
*** Fri, 28 Apr 2017 10:00:01 -0400 *** /: 2 GiB (2105540608 bytes) trimmed

With Scheduled Tasks you could also, for example, change the time when Lite Updates Notify checks for new updates as I mentioned at the beginning of this post, but I’ll leave that for another day.

❤ Linux Lite?… come and join us in the forum!

Related Post

Numlock in Linux Mint Let's see; you want Numlock to be on (enabled) when the system starts. After all, if your password has numbers it's annoying to find out you can't log...
Dnsmasq for easy LAN DNS services Dnsmasq is a lightweight DNS, DNS caching, DHCP and TFTP server. It is intended to provide reliable services in small networks. Dnsmasq accepts DNS q...
Linux Mint 17.2 Rafaela on MacBook 4,1 (late 2007)... So you installed Linux Mint in a Macbook 4,1 (or older version) and found out that the iSight webcam does not work. Hmmm... but you want to use your M...