<?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: Shell Scripting: Create Report / Log File Names With Date in Filenames</title> <atom:link href="http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Walt</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-178502</link> <dc:creator>Walt</dc:creator> <pubDate>Fri, 13 Jan 2012 13:47:26 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-178502</guid> <description>I need to use gzip and make the date (month and year) part of the output filename.
How can this be done.
example ;
input filename:  FMMI.HHS.JJJJ
FMMI.HHS.JJJJ
output file name: FMMI.HHS.0112    (MMYY)</description> <content:encoded><![CDATA[<p>I need to use gzip and make the date (month and year) part of the output filename.<br
/> How can this be done.</p><p>example ;</p><p>input filename:  FMMI.HHS.JJJJ<br
/> FMMI.HHS.JJJJ</p><p>output file name: FMMI.HHS.0112    (MMYY)</p> ]]></content:encoded> </item> <item><title>By: Priyanka</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-175928</link> <dc:creator>Priyanka</dc:creator> <pubDate>Wed, 23 Nov 2011 08:25:45 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-175928</guid> <description>Great code..Helped a lot !! Thanx Vivek!!!</description> <content:encoded><![CDATA[<p>Great code..Helped a lot !! Thanx Vivek!!!</p> ]]></content:encoded> </item> <item><title>By: mule.ear</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-175003</link> <dc:creator>mule.ear</dc:creator> <pubDate>Wed, 19 Oct 2011 18:17:49 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-175003</guid> <description>Very late to answer this, but...
One way to manipulate the date variable is:
DAY=$(date +&quot;%d&quot;)
DAY=$((DAY-1))
echo $DAY</description> <content:encoded><![CDATA[<p>Very late to answer this, but&#8230;</p><p>One way to manipulate the date variable is:</p><p>DAY=$(date +&#8221;%d&#8221;)<br
/> DAY=$((DAY-1))<br
/> echo $DAY</p> ]]></content:encoded> </item> <item><title>By: Habeeb</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-174710</link> <dc:creator>Habeeb</dc:creator> <pubDate>Sat, 08 Oct 2011 23:40:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-174710</guid> <description>Thanks man you are awesome.......</description> <content:encoded><![CDATA[<p>Thanks man you are awesome&#8230;&#8230;.</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-173899</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Tue, 13 Sep 2011 05:28:22 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-173899</guid> <description>No need to be rude. Each setup has unique requirements. So I used MM-DD-YYYY format, but that doesn&#039;t mean I&#039;m an idiot.
Have a nice day!</description> <content:encoded><![CDATA[<p>No need to be rude. Each setup has unique requirements. So I used MM-DD-YYYY format, but that doesn&#8217;t mean I&#8217;m an idiot.</p><p>Have a nice day!</p> ]]></content:encoded> </item> <item><title>By: Bernd</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-173881</link> <dc:creator>Bernd</dc:creator> <pubDate>Mon, 12 Sep 2011 16:47:53 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-173881</guid> <description>Exactly, what kind of idiot would use the MONTH-DAY-YEAR format for filenames? Once again the comment section has a higher quality than the article.</description> <content:encoded><![CDATA[<p>Exactly, what kind of idiot would use the MONTH-DAY-YEAR format for filenames? Once again the comment section has a higher quality than the article.</p> ]]></content:encoded> </item> <item><title>By: Poli</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-172781</link> <dc:creator>Poli</dc:creator> <pubDate>Tue, 26 Jul 2011 09:03:38 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-172781</guid> <description>What about to start apps via script and set today&#039;s date to log at the time of app start?</description> <content:encoded><![CDATA[<p>What about to start apps via script and set today&#8217;s date to log at the time of app start?</p> ]]></content:encoded> </item> <item><title>By: John</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-171817</link> <dc:creator>John</dc:creator> <pubDate>Thu, 09 Jun 2011 04:39:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-171817</guid> <description>Thanks
This helped me heaps with what i was trying to do.</description> <content:encoded><![CDATA[<p>Thanks</p><p>This helped me heaps with what i was trying to do.</p> ]]></content:encoded> </item> <item><title>By: prasanna</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-169403</link> <dc:creator>prasanna</dc:creator> <pubDate>Wed, 02 Mar 2011 05:46:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-169403</guid> <description>how to create log/files using yesterday,s date....</description> <content:encoded><![CDATA[<p>how to create log/files using yesterday,s date&#8230;.</p> ]]></content:encoded> </item> <item><title>By: richa</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-154209</link> <dc:creator>richa</dc:creator> <pubDate>Thu, 11 Mar 2010 06:09:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-154209</guid> <description>very nice and helpful...thanks</description> <content:encoded><![CDATA[<p>very nice and helpful&#8230;thanks</p> ]]></content:encoded> </item> <item><title>By: Spenser</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-152683</link> <dc:creator>Spenser</dc:creator> <pubDate>Sat, 02 Jan 2010 16:28:38 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-152683</guid> <description>Exactly what I needed. Thanks!</description> <content:encoded><![CDATA[<p>Exactly what I needed. Thanks!</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-143796</link> <dc:creator>vivek</dc:creator> <pubDate>Fri, 16 May 2008 13:16:15 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-143796</guid> <description>Phil,
Try &lt;a href=/tips/howto-unix-linux-easy-date-manipulation-with-yest.html rel=&quot;nofollow&quot;&gt;yest&lt;/a&gt;</description> <content:encoded><![CDATA[<p>Phil,</p><p>Try <a
href=/tips/howto-unix-linux-easy-date-manipulation-with-yest.html rel="nofollow">yest</a></p> ]]></content:encoded> </item> <item><title>By: Phil</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-143795</link> <dc:creator>Phil</dc:creator> <pubDate>Fri, 16 May 2008 13:10:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-143795</guid> <description>Okay, but how do I retrieve and format YESTERDAY&#039;s date? Or, more generally, how do I perform date &quot;arithmetic&quot; from a shell script (adding days / weeks, etc)?</description> <content:encoded><![CDATA[<p>Okay, but how do I retrieve and format YESTERDAY&#8217;s date? Or, more generally, how do I perform date &#8220;arithmetic&#8221; from a shell script (adding days / weeks, etc)?</p> ]]></content:encoded> </item> <item><title>By: Itpatil</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-143772</link> <dc:creator>Itpatil</dc:creator> <pubDate>Tue, 13 May 2008 17:19:40 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-143772</guid> <description>Thank you. Very helpful.</description> <content:encoded><![CDATA[<p>Thank you. Very helpful.</p> ]]></content:encoded> </item> <item><title>By: Aaron</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-141314</link> <dc:creator>Aaron</dc:creator> <pubDate>Mon, 08 Oct 2007 18:44:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-141314</guid> <description>Awesome stuff, you have save me tons of time</description> <content:encoded><![CDATA[<p>Awesome stuff, you have save me tons of time</p> ]]></content:encoded> </item> <item><title>By: Kate Ward</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-62575</link> <dc:creator>Kate Ward</dc:creator> <pubDate>Thu, 18 Jan 2007 20:15:31 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-62575</guid> <description>Take a look at log4sh [http://log4sh.sourceforge.net/] as well. It might be a better choice for your logging needs.</description> <content:encoded><![CDATA[<p>Take a look at log4sh [http://log4sh.sourceforge.net/] as well. It might be a better choice for your logging needs.</p> ]]></content:encoded> </item> <item><title>By: andreyev</title><link>http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-19467</link> <dc:creator>andreyev</dc:creator> <pubDate>Wed, 14 Jun 2006 18:21:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html#comment-19467</guid> <description>IMHU, to see a sorted list of log files the best date options is &quot;+%Y%m%d%H%M%S&quot;. Separate fields with hyphen could make it more human readable.
When a lot of instances of your program is running simultaneously, may you should add the PID to this string.</description> <content:encoded><![CDATA[<p>IMHU, to see a sorted list of log files the best date options is &#8220;+%Y%m%d%H%M%S&#8221;. Separate fields with hyphen could make it more human readable.</p><p>When a lot of instances of your program is running simultaneously, may you should add the PID to this string.</p> ]]></content:encoded> </item> </channel> </rss>
