<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Wana help in writing a script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015242#M96440</link>
    <description>&lt;!--!*#--&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I am looking for a command which can filter out all the files which have been created or modified 15 days or before from the today's date.&lt;BR /&gt;And I have to run this script/command on daily basis. So I want it to take current system date itself (I mean I want to make it generalize).&lt;BR /&gt;Can any buddy help me out in this.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ashish</description>
    <pubDate>Thu, 07 Jun 2007 06:34:42 GMT</pubDate>
    <dc:creator>cse.ashish</dc:creator>
    <dc:date>2007-06-07T06:34:42Z</dc:date>
    <item>
      <title>Wana help in writing a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015242#M96440</link>
      <description>&lt;!--!*#--&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;I am looking for a command which can filter out all the files which have been created or modified 15 days or before from the today's date.&lt;BR /&gt;And I have to run this script/command on daily basis. So I want it to take current system date itself (I mean I want to make it generalize).&lt;BR /&gt;Can any buddy help me out in this.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ashish</description>
      <pubDate>Thu, 07 Jun 2007 06:34:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015242#M96440</guid>
      <dc:creator>cse.ashish</dc:creator>
      <dc:date>2007-06-07T06:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Wana help in writing a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015243#M96441</link>
      <description>You want to look at the find command.  I think what you're saying is you want to exclude the files from the most recent 15 day period?  This should do it:&lt;BR /&gt;&lt;BR /&gt;find /start_dir -type f -mtime +15&lt;BR /&gt;&lt;BR /&gt;That will give you a list of files created or modified prior to the last 15 days.&lt;BR /&gt;&lt;BR /&gt;To exclude those:&lt;BR /&gt;&lt;BR /&gt;find /start_dir -type f ! -mtime +15&lt;BR /&gt;&lt;BR /&gt;The results of either of those can be piped to xargs to take some action on them.  To remove the files older than 15 days:&lt;BR /&gt;&lt;BR /&gt;find /start_dir -type f -mtime +15 |xargs rm&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 07 Jun 2007 06:49:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015243#M96441</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2007-06-07T06:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Wana help in writing a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015244#M96442</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;First, Unix does not have a "creation" timestamp.  There is a last-modified ('mtime') value that at the moment of creation represents the named time but thereafter the value is the last modification time.&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -mtime +15&lt;BR /&gt;&lt;BR /&gt;See the manpages for 'find(1) and 'stat(2)' for more details.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Jun 2007 06:50:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015244#M96442</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-07T06:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Wana help in writing a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015245#M96443</link>
      <description>Hi Ashish,&lt;BR /&gt;&lt;BR /&gt;maybe a command like this :&lt;BR /&gt;&lt;BR /&gt;find / -type f -mtime +15 -print -exec ls {} \;&lt;BR /&gt;&lt;BR /&gt;(that take file older than 15 days)&lt;BR /&gt;could be a good starting point for your script.&lt;BR /&gt;&lt;BR /&gt;Hth&lt;BR /&gt;regards&lt;BR /&gt;pg</description>
      <pubDate>Thu, 07 Jun 2007 06:51:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015245#M96443</guid>
      <dc:creator>Piergiacomo Perini</dc:creator>
      <dc:date>2007-06-07T06:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Wana help in writing a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015246#M96444</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I guess I'm interpreting Ashish's request differently...&lt;BR /&gt;&lt;BR /&gt;Show files in /path with last modified time less than 15 days:&lt;BR /&gt;&lt;BR /&gt;$ find /path -type f -mtime -15 -print&lt;BR /&gt;&lt;BR /&gt;If you wish to perform an action on these files, 'find' has the '-exec &lt;CMD&gt;' primary.  You could also pipe the output from 'find' to 'xargs', or to an external file, which you would then read in at a later point.&lt;BR /&gt;&lt;BR /&gt;Note that there is no notion of a "creation date" for files under UNIX.  However, as long as a file's timestamp hasn't changed since it was created, last modification time will function as a pseudo-creation time.&lt;BR /&gt;&lt;BR /&gt;PCS&lt;/CMD&gt;</description>
      <pubDate>Thu, 07 Jun 2007 06:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015246#M96444</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-06-07T06:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Wana help in writing a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015247#M96445</link>
      <description>Thanks a lot to all. I'll try this and use the same in my script.&lt;BR /&gt;&lt;BR /&gt;And yes, It was my mistake to write "creation time" in my question. May be because of too much of work :) I wrote that. But I meant actually with modified time only.&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Ashish&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jun 2007 09:17:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/wana-help-in-writing-a-script/m-p/4015247#M96445</guid>
      <dc:creator>cse.ashish</dc:creator>
      <dc:date>2007-06-07T09:17:21Z</dc:date>
    </item>
  </channel>
</rss>

