<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=2022&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / [Miyo] How to set daily trim job? [SOLVED]]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=2022</link>
		<description><![CDATA[The most recent posts in [Miyo] How to set daily trim job? [SOLVED].]]></description>
		<lastBuildDate>Wed, 02 May 2018 23:57:53 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8766#p8766</link>
			<description><![CDATA[<p>Thanks guys. I marked as solved.</p>]]></description>
			<author><![CDATA[dummy@example.com (Ron)]]></author>
			<pubDate>Wed, 02 May 2018 23:57:53 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8766#p8766</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8761#p8761</link>
			<description><![CDATA[<div class="quotebox"><cite>GNUser wrote:</cite><blockquote><div><p>the <span class="bbc">|| true</span> is not only superfluous, it can potentially be misleading</p></div></blockquote></div><p><img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /><br />My guess is that Mint chains the output to some other command or logger, or as you said, to keep the anacron job going without pause, but at the cost of not knowing that your fstrim failed or why.&#160; Couldn&#039;t say for sure, though.</p><p>@Ron: I&#039;m glad you solved your task.&#160; Linux has a lot of options and ways to approach problems.&#160; It looks like you found one that works for your needs.&#160; Never stop learning <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (siva)]]></author>
			<pubDate>Wed, 02 May 2018 18:03:52 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8761#p8761</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8740#p8740</link>
			<description><![CDATA[<p>Yes, you can mark it as solved. The timestamp in <span class="bbc">/var/spool/anacron/</span> is proof that the job ran <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Now we&#039;re just making things more elegant and streamlined.</p><div class="quotebox"><cite>Ron wrote:</cite><blockquote><div><p>You mean I really don&#039;t even need the trim script file?</p></div></blockquote></div><p>That&#039;s correct. For a simple one-liner task such as this, you don&#039;t need a script. I didn&#039;t want to point it out before--thinking it might be rewarding for you to get this working &quot;your way&quot;--but you can accomplish what you need by simply having this in <span class="bbc">/etc/anacrontab</span>:</p><div class="codebox"><pre><code>1 8    automatic.trim   /sbin/fstrim --all</code></pre></div><p>(siva is right: the <span class="bbc">|| true</span> is not only superfluous, it can potentially be misleading. <strong>Without</strong> <span class="bbc">|| true</span> in there, if the fstrim command fails (not that it ever should) then the overall anacron job fails and if you investigate you&#039;ll be able to see that it failed. <strong>With</strong> <span class="bbc">|| true</span> in there, if the fstrim command fails then the <span class="bbc">true</span> command runs, completes successfully (the <span class="bbc">true</span> command always does nothing and completes sucessfully--that is what it does by design, which seems silly but is actually useful in several settings), and the overall anacron job completes successfully because the last command it ran completed successfully.)</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Wed, 02 May 2018 03:03:50 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8740#p8740</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8739#p8739</link>
			<description><![CDATA[<div class="quotebox"><cite>siva wrote:</cite><blockquote><div><p>2. I really want to know why your anacrontab doesn&#039;t read:<br /><span class="bbc">1 8&#160; &#160; automatic.trim&#160; &#160;/sbin/fstrim --all || true</span><br />Also, what&#039;s the rationale behind keeping the &quot; || true&quot; statement?</p></div></blockquote></div><p>You mean I really don&#039;t even need the trim script file?</p><p>As for the <span class="bbc">|| true</span>, I have no idea. I kept the file exactly the same as it was in Mint. Also, thanks for the tip in #1, and your link in your previous post.</p><p>And before I forget, <strong>many thanks</strong> to both siva and GNUser. I&#039;m getting closer to ditching Mint and going with Miyo full-time.</p>]]></description>
			<author><![CDATA[dummy@example.com (Ron)]]></author>
			<pubDate>Wed, 02 May 2018 01:45:32 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8739#p8739</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8738#p8738</link>
			<description><![CDATA[<p>Looks like you&#039;ve made your first cron job <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Some final thoughts:<br />1. anacron should have its own service that can be managed with the &quot;service&quot; command.&#160; Example: <span class="bbc">service anacron restart</span> can be used in lieu of rebooting your entire system.&#160; This is true of many services: <span class="bbc">service --status-all</span></p><p>2. I really want to know why your anacrontab doesn&#039;t read:<br /><span class="bbc">1 8&#160; &#160; automatic.trim&#160; &#160;/sbin/fstrim --all || true</span><br />Also, what&#039;s the rationale behind keeping the &quot; || true&quot; statement?</p>]]></description>
			<author><![CDATA[dummy@example.com (siva)]]></author>
			<pubDate>Wed, 02 May 2018 01:27:05 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8738#p8738</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8737#p8737</link>
			<description><![CDATA[<p>Okay, I think it&#039;s finally working in a way I can understand. First, I delete the trim file out of the <span class="bbc">/etc/cron.daily</span> folder (and kept the one in my Documents folder). Then I went back to the anacron file in <span class="bbc">/etc</span> and added this:</p><p><span class="bbc">1 8&#160; &#160; automatic.trim&#160; &#160;/bin/bash /home/ron/Documents/trim</span></p><p>I changed 10 minutes to 8 and using your suggestion named it automatic.trim. Rebooted and ran <span class="bbc">sudo cat /var/log/syslog | grep anacron</span> and got this on one line:</p><div class="codebox"><pre><code>May  1 19:06:28 localhost anacron[1661]: Will run job `automatic.trim&#039; in 8 min.</code></pre></div><p>Finally, checked that the log file automatic.trim exists, opened it up and found this: 20180501.</p><p>So, can I finally consider this as SOLVED? <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Ron)]]></author>
			<pubDate>Wed, 02 May 2018 01:18:22 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8737#p8737</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8736#p8736</link>
			<description><![CDATA[<div class="quotebox"><cite>GNUser wrote:</cite><blockquote><div><p>I prefer to have my scripts be their own separate jobs, because then they get their own separate timestamp file in <span class="bbc">/var/spool/anacron/</span> and things are a bit more explicit.</p></div></blockquote></div><p><del>Wouldn&#039;t the --verbose flag achieve the same result?<br /><a href="https://man.cx/run-parts(8)" rel="nofollow">https://man.cx/run-parts(8)</a></del><br />Scratch that, I see what you meant.</p>]]></description>
			<author><![CDATA[dummy@example.com (siva)]]></author>
			<pubDate>Wed, 02 May 2018 00:56:34 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8736#p8736</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8735#p8735</link>
			<description><![CDATA[<p>Now you&#039;re cooking.</p><p><span class="bbc">cron.daily</span> is a separate job. Yours is called <span class="bbc">example.daily</span> and you are correct: You don&#039;t see it in syslog because you need to re-add it to <span class="bbc">/etc/anacrontab</span>. The name of the job can be anything you want, by the way, so feel free to give it a more descriptive name such as <span class="bbc">automatic.trim</span> or the like.</p><p>You can do it either way, Ron. If you put the script in <span class="bbc">/etc/cron.daily/</span> then the script will be run as part of the <span class="bbc">cron.daily</span> job which comes with anacron by default (take a look inside /etc/anacrontab and you&#039;ll see the cron.daily job listed there). I prefer to have my scripts be their own separate jobs, because then they get their own separate timestamp file in <span class="bbc">/var/spool/anacron/</span> and things are a bit more explicit.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Wed, 02 May 2018 00:47:02 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8735#p8735</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8734#p8734</link>
			<description><![CDATA[<p>Here are some follow-up questions for you to consider:</p><p>How can you check if your script is in cron.daily?<br />What is the syntax for anacrontab?<br />How can you determine if anacron is running scripts?<br />How can you determine if anacron has ran your script?</p><p>If you can answer these, you&#039;ll probably be able to figure out your question.<br />Best of luck.</p>]]></description>
			<author><![CDATA[dummy@example.com (siva)]]></author>
			<pubDate>Wed, 02 May 2018 00:45:56 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8734#p8734</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8733#p8733</link>
			<description><![CDATA[<p>Okay, one thing I just realized in looking at the anacrontab file in /etc. There is the following line:</p><p><span class="bbc">1&#160; &#160; 5&#160; &#160; cron.daily&#160; &#160; run-parts --report /etc/cron.daily</span></p><p>I had previously put the script trim in /etc/cron.daily (and it&#039;s still there) so does that mean that trim ran?</p>]]></description>
			<author><![CDATA[dummy@example.com (Ron)]]></author>
			<pubDate>Wed, 02 May 2018 00:38:21 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8733#p8733</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8731#p8731</link>
			<description><![CDATA[<p>I just finished all the steps you gave me. It appears to have worked but I have one question. When I ran <span class="bbc">sudo cat /var/log/syslog | grep anacron</span> I got this:</p><div class="codebox"><pre><code>May  1 18:09:38 localhost anacron[1659]: Anacron 2.3 started on 2018-05-01
May  1 18:09:38 localhost anacron[1659]: Will run job `cron.daily&#039; in 5 min.
May  1 18:09:38 localhost anacron[1659]: Will run job `cron.weekly&#039; in 10 min.
May  1 18:09:38 localhost anacron[1659]: Will run job `cron.monthly&#039; in 15 min.
May  1 18:09:38 localhost anacron[1659]: Jobs will be executed sequentially</code></pre></div><p>Any idea why it says the daily cron will run in 5 minutes when it&#039;s set for 10?</p><p><strong>EDIT</strong>: I think I know what happened. After installing anacron, I should have went back to re-add the line <br /><span class="bbc">1 10&#160; &#160; example.daily&#160; &#160;/bin/bash /home/ron/Documents/trim</span>. I&#039;m going back to add it again and retry everything. It should work this time!</p>]]></description>
			<author><![CDATA[dummy@example.com (Ron)]]></author>
			<pubDate>Wed, 02 May 2018 00:28:51 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8731#p8731</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8730#p8730</link>
			<description><![CDATA[<div class="quotebox"><cite>Ron wrote:</cite><blockquote><div><p><span class="bbc">which anacron</span> returned nothing while almost every line from <span class="bbc">find / -iname anacron</span> ended with Permission denied.</p></div></blockquote></div><p>Ron, anacron isn&#039;t even installed on your system. In my previous post I listed everything you need to do. Sorry but unless you try what I suggested I cannot help you further.</p><p>The script will do what you want it to.</p>]]></description>
			<author><![CDATA[dummy@example.com (GNUser)]]></author>
			<pubDate>Wed, 02 May 2018 00:20:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8730#p8730</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8729#p8729</link>
			<description><![CDATA[<p>Your script is three lines.&#160; The third line contains the actual command you want to run.&#160; And the command you want to run is only one line.<br />The only case in which I could see this being launched as a script is one where you want to add or modify to this command.&#160; However, it doesn&#039;t sound like you want to in this case.</p><div class="quotebox"><cite>Ron wrote:</cite><blockquote><div><p>Permission denied.</p></div></blockquote></div><p>Linux has several ways of saying, &quot;you need to access this as root.&quot;&#160; We talked about /sbin already.&#160; And there is more than one protected folder in your filesystem.</p><div class="quotebox"><blockquote><div><p>can I turn this script into an .sh file</p></div></blockquote></div><p>File extensions don&#039;t matter in linux like they do in windows.&#160; However, your script includes a crunchbang (#!) with the interpreter as line 1.&#160; So, for most cases, you shouldn&#039;t need to launch it by first running /bin/bash.&#160; However, your file manager may be fickle about how it launches, and I don&#039;t know which file manager miyo uses.</p><p>I think it would be helpful to research shell scripting.&#160; Nothing beats independent research.&#160; If you want to analyze some simple ones for reference, you can check out some that I made for my Linux systems:<br /><a href="https://github.com/souperdoupe/crunkbong/tree/master/utils/scripts" rel="nofollow">https://github.com/souperdoupe/crunkbon … ls/scripts</a></p><p>EDIT: to support what GNUser said below, &quot;which&quot; will usually determine if you have a program installed; it&#039;s useful because sometimes developers will change the installation path for an app (a common practice between *nix and *bsd distributions).&#160; In debian, an even easier way to check for an app is to simply &quot;apt-get install&quot; your program.&#160; <img src="https://dev1galaxy.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (siva)]]></author>
			<pubDate>Wed, 02 May 2018 00:20:20 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8729#p8729</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8727#p8727</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p><strong>GNUser wrote:</strong><br />Would you kindly share the contents of that file?</p></div></blockquote></div><div class="codebox"><pre><code>#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true</code></pre></div><div class="quotebox"><blockquote><div><p><strong>siva wrote:</strong><br />A) which program<br />B) find / -iname *program*</p></div></blockquote></div><p><span class="bbc">which anacron</span> returned nothing while almost every line from <span class="bbc">find / -iname anacron</span> ended with Permission denied.</p><div class="quotebox"><blockquote><div><p><strong>siva wrote:</strong><br />To reiterate, I&#039;m not sure why you&#039;re pointing cron to a script that runs a simple command.&#160; I would use a script if there were a series of lines.</p></div></blockquote></div><p>If I had to do it manually, I&#039;d probably forget about it. <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /> One thing I&#039;m wondering about, can I turn this script into an .sh file that will run when I click on it?</p>]]></description>
			<author><![CDATA[dummy@example.com (Ron)]]></author>
			<pubDate>Wed, 02 May 2018 00:06:15 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8727#p8727</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Miyo] How to set daily trim job? [SOLVED]]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=8718#p8718</link>
			<description><![CDATA[<p>@Ron: never apologize for making an effort to develop your understanding of a topic.</p><p>Two ways you can verify if a program is installed.&#160; Replace &quot;program&quot; with anacron:<br />A) which program<br />The which command will print the full path of your program.&#160; If it isn&#039;t in your executables path, the output will be blank.&#160; If you want to check which directories are in your path, run &quot;echo $PATH&quot;.&#160; &#160;Note that root has different folders in their path than normal users, including /sbin.<br />B) find / -iname *program*<br />This will take awhile, but if it is anywhere in your system, it should find it.&#160; This works for any file or directory, by the way.&#160; -iname will ignore case (uppercase or lowercase) differences.&#160; The asterisks (*) is a bash wildcard; in this case, find will find any file or folder with the string &quot;anacron&quot;.</p><p>There are many more ways, but I prefer these.</p><p>You may want to research cron.daily and the others. </p><p>To reiterate, I&#039;m not sure why you&#039;re pointing cron to a script that runs a simple command.&#160; I would use a script if there were a series of lines.</p><p>Yesterday, Gnuser linked to an interesting case regarding anacron.&#160; I&#039;m assuming you read it.&#160; No idea if it applies to your situation.&#160; In any case, reinstalling&#160; or installing anacron is trivial.</p>]]></description>
			<author><![CDATA[dummy@example.com (siva)]]></author>
			<pubDate>Tue, 01 May 2018 22:36:48 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=8718#p8718</guid>
		</item>
	</channel>
</rss>
