<?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: Last-day-of-month cron job</title>
	<atom:link href="http://backreference.org/2010/04/05/last-day-of-month-cron-job/feed/" rel="self" type="application/rss+xml" />
	<link>http://backreference.org/2010/04/05/last-day-of-month-cron-job/</link>
	<description>Capture and remember</description>
	<lastBuildDate>Sun, 19 Feb 2012 14:22:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Carl Wenninger</title>
		<link>http://backreference.org/2010/04/05/last-day-of-month-cron-job/comment-page-1/#comment-24681</link>
		<dc:creator>Carl Wenninger</dc:creator>
		<pubDate>Thu, 18 Aug 2011 21:58:37 +0000</pubDate>
		<guid isPermaLink="false">http://backreference.org/?p=1141#comment-24681</guid>
		<description>An excellent discussion of this topic!

Here is a C-Variant of the above Perl-Code.
The cmd-part of the crontab-line will look like
is-last-day-month &amp;&amp; my-cron-job.sh

#include &lt;time.h&gt;

int main()
{
    time_t t;

     
    t = time(NULL) + 86400; 
    return localtime(&amp;t)-&gt;tm_mday == 1;
}</description>
		<content:encoded><![CDATA[<p>An excellent discussion of this topic!</p>
<p>Here is a C-Variant of the above Perl-Code.<br />
The cmd-part of the crontab-line will look like<br />
is-last-day-month &amp;&amp; my-cron-job.sh</p>
<p>#include &lt;time.h&gt;</p>
<p>int main()<br />
{<br />
    time_t t;</p>
<p>    t = time(NULL) + 86400;<br />
    return localtime(&amp;t)-&gt;tm_mday == 1;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: waldner</title>
		<link>http://backreference.org/2010/04/05/last-day-of-month-cron-job/comment-page-1/#comment-24673</link>
		<dc:creator>waldner</dc:creator>
		<pubDate>Wed, 03 Aug 2011 18:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://backreference.org/?p=1141#comment-24673</guid>
		<description>Thanks, fixed.</description>
		<content:encoded><![CDATA[<p>Thanks, fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://backreference.org/2010/04/05/last-day-of-month-cron-job/comment-page-1/#comment-24672</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Wed, 03 Aug 2011 15:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://backreference.org/?p=1141#comment-24672</guid>
		<description>Typo above with the one liner in the Non-GNU systems section -

$perl -e &#039;print ((localtime(time+86400)[3] . &quot;\n&quot;)&#039;
syntax error at -e line 1, near &quot;)[&quot;
Execution of -e aborted due to compilation errors.

The following works for me...

$ perl -e &#039;print ((localtime(time+86400))[3] . &quot;\n&quot;)&#039;
4</description>
		<content:encoded><![CDATA[<p>Typo above with the one liner in the Non-GNU systems section -</p>
<p>$perl -e 'print ((localtime(time+86400)[3] . "\n")'<br />
syntax error at -e line 1, near ")["<br />
Execution of -e aborted due to compilation errors.</p>
<p>The following works for me...</p>
<p>$ perl -e 'print ((localtime(time+86400))[3] . "\n")'<br />
4</p>
]]></content:encoded>
	</item>
</channel>
</rss>

