<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How To Run a Cron Job Every 30 Seconds in Linux	</title>
	<atom:link href="https://www.tecmint.com/run-cronjob-every-x-seconds/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/run-cronjob-every-x-seconds/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Thu, 13 Jul 2023 15:58:30 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Onan the Barbarian		</title>
		<link>https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1941871</link>

		<dc:creator><![CDATA[Onan the Barbarian]]></dc:creator>
		<pubDate>Wed, 04 Jan 2023 09:02:48 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=48957#comment-1941871</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933828&quot;&gt;Aaron Kili&lt;/a&gt;.

That doesn&#039;t work. The first example runs a job at second 0 and another at second 17 of every minute. The second run is at second 0 and 30.

To really run a job every 77 seconds, you need to run it:

- at second 0 of the first minute.
- at the second 17 of the second minute.
- at second 34 of the third minute.
- at second 51 of the fourth minute.
- at second 8 of the sixth minute.

and so on. The cycle repeats every 77 minutes.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933828">Aaron Kili</a>.</p>
<p>That doesn&#8217;t work. The first example runs a job at second 0 and another at second 17 of every minute. The second run is at second 0 and 30.</p>
<p>To really run a job every 77 seconds, you need to run it:</p>
<p>&#8211; at second 0 of the first minute.<br />
&#8211; at the second 17 of the second minute.<br />
&#8211; at second 34 of the third minute.<br />
&#8211; at second 51 of the fourth minute.<br />
&#8211; at second 8 of the sixth minute.</p>
<p>and so on. The cycle repeats every 77 minutes.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aaron Kili		</title>
		<link>https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933828</link>

		<dc:creator><![CDATA[Aaron Kili]]></dc:creator>
		<pubDate>Wed, 21 Dec 2022 10:50:33 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=48957#comment-1933828</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1931411&quot;&gt;dragonmouth&lt;/a&gt;.

@dragonmouth and @Biapy

From the man page of the &lt;strong&gt;sleep&lt;/strong&gt; command, the &lt;strong&gt;sleep&lt;/strong&gt; command pauses for &lt;code&gt;x&lt;/code&gt; number of seconds and the suffix is &lt;code&gt;s&lt;/code&gt; for seconds, the default or &lt;code&gt;m&lt;/code&gt; for minutes. 

To schedule a job for 77 seconds, simply add these entries in the crontab:
&lt;pre&gt;
* * * * * date&#062;&#062; /tmp/date.log
* * * * * sleep 77; date&#062;&#062; /tmp/date.log
&lt;/pre&gt;
For 90 seconds, use this:
&lt;pre&gt;
* * * * * date&#062;&#062; /tmp/date.log
* * * * * sleep 90; date&#062;&#062; /tmp/date.log
&lt;/pre&gt;
]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1931411">dragonmouth</a>.</p>
<p>@dragonmouth and @Biapy</p>
<p>From the man page of the <strong>sleep</strong> command, the <strong>sleep</strong> command pauses for <code>x</code> number of seconds and the suffix is <code>s</code> for seconds, the default or <code>m</code> for minutes. </p>
<p>To schedule a job for 77 seconds, simply add these entries in the crontab:</p>
<pre>
* * * * * date&gt;&gt; /tmp/date.log
* * * * * sleep 77; date&gt;&gt; /tmp/date.log
</pre>
<p>For 90 seconds, use this:</p>
<pre>
* * * * * date&gt;&gt; /tmp/date.log
* * * * * sleep 90; date&gt;&gt; /tmp/date.log
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aaron Kili		</title>
		<link>https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933817</link>

		<dc:creator><![CDATA[Aaron Kili]]></dc:creator>
		<pubDate>Wed, 21 Dec 2022 10:04:28 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=48957#comment-1933817</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933048&quot;&gt;Biapy&lt;/a&gt;.

@Biapy

I will give systemd a try to implement a solution to the above problem. 

Many thanks for sharing your thoughts about this post.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933048">Biapy</a>.</p>
<p>@Biapy</p>
<p>I will give systemd a try to implement a solution to the above problem. </p>
<p>Many thanks for sharing your thoughts about this post.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Biapy		</title>
		<link>https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933051</link>

		<dc:creator><![CDATA[Biapy]]></dc:creator>
		<pubDate>Mon, 19 Dec 2022 07:57:43 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=48957#comment-1933051</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1931411&quot;&gt;dragonmouth&lt;/a&gt;.

Hi,

This method can be used but is really not recommended. The trick is to use a number of minutes that is a direct multiple of the number of seconds wanted. E.g. for the 90s, setup the cron task to be launched every 3 minutes (e.g. &lt;strong&gt;90s * 2&lt;/strong&gt;):
&lt;pre&gt;
*/3 * * * * date&#062;&#062; /tmp/date.log
*/3 * * * * sleep 90; date&#062;&#062; /tmp/date.log
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1931411">dragonmouth</a>.</p>
<p>Hi,</p>
<p>This method can be used but is really not recommended. The trick is to use a number of minutes that is a direct multiple of the number of seconds wanted. E.g. for the 90s, setup the cron task to be launched every 3 minutes (e.g. <strong>90s * 2</strong>):</p>
<pre>
*/3 * * * * date&gt;&gt; /tmp/date.log
*/3 * * * * sleep 90; date&gt;&gt; /tmp/date.log
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Biapy		</title>
		<link>https://www.tecmint.com/run-cronjob-every-x-seconds/comment-page-1/#comment-1933048</link>

		<dc:creator><![CDATA[Biapy]]></dc:creator>
		<pubDate>Mon, 19 Dec 2022 07:52:17 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=48957#comment-1933048</guid>

					<description><![CDATA[Hi,

In my opinion, if a &lt;strong&gt;cronjob&lt;/strong&gt; is needed to run so often, it is either time to daemonize it using &lt;strong&gt;systemd&lt;/strong&gt;, and/or implement an event-driven task (e.g. use &lt;strong&gt;inotifywait&lt;/strong&gt; to watch for filesystem changes).

Either way, thank you for your work on this blog.]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>In my opinion, if a <strong>cronjob</strong> is needed to run so often, it is either time to daemonize it using <strong>systemd</strong>, and/or implement an event-driven task (e.g. use <strong>inotifywait</strong> to watch for filesystem changes).</p>
<p>Either way, thank you for your work on this blog.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
