LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2016, 06:11 AM   #1
hifi100
Member
 
Registered: Sep 2016
Distribution: Debian 9
Posts: 75

Rep: Reputation: Disabled
How to add fstrim to cron job ?


Hi,

I am using a Samsung SSD to boot Debian testing. I want to automate fstrim weekly. How do I do it ?
 
Old 09-24-2016, 11:13 AM   #2
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, Fedora & Arch mostly.
Posts: 2,428

Rep: Reputation: 648Reputation: 648Reputation: 648Reputation: 648Reputation: 648Reputation: 648
https://wiki.archlinux.org/index.php/Solid_State_Drives

Read through that, it's extremely good documentation for SSD's in general. Although written for Arch, it applies to Debian as well.
 
Old 09-24-2016, 11:20 AM   #3
hifi100
Member
 
Registered: Sep 2016
Distribution: Debian 9
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Timothy Miller View Post
https://wiki.archlinux.org/index.php/Solid_State_Drives

Read through that, it's extremely good documentation for SSD's in general. Although written for Arch, it applies to Debian as well.
Read that link but it has no info about how to add a cron job.
 
Old 09-24-2016, 11:28 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,557

Rep: Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810
probably:
http://www.cyberciti.biz/faq/how-do-...-or-unix-oses/
https://help.ubuntu.com/community/CronHowto
 
Old 09-24-2016, 11:31 AM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,575

Rep: Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425
The Arch wiki tells you that systemd can have fstrim.service and fstrim.timer added which, once enabled, will do the job for you without the need to write your own scripts. I presume that they are also available for Debian.
 
Old 09-24-2016, 11:40 AM   #6
hifi100
Member
 
Registered: Sep 2016
Distribution: Debian 9
Posts: 75

Original Poster
Rep: Reputation: Disabled
Found the solution in the show notes of this video
 
  


Reply

Tags
fstrim


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a weekly cron job DelMab Linux - Software 18 11-27-2015 07:38 AM
[SOLVED] BASH: Add cron job to run hourly worm5252 Programming 9 03-26-2010 10:36 AM
add a job to cron.daily pbxuser911 Linux - Server 9 10-29-2009 12:30 AM
linux cron job duplicate job question cpthk Linux - Newbie 4 09-11-2009 08:52 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration