<?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 Re: Script to move old files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5322173#M641996</link>
    <description>&lt;P&gt;&amp;gt;The command you provided is for request 1, can advise if I would like to do the thing as point 2, what can I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea was that you would figure 2) out from the solution to 1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find /tmp -mtime +180 -type f | while read filename; do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gzip -c "$file" &amp;gt; "/tmp/bak/$file.gz"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if [ $? -eq 0 ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rm -f "$file"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Problem gzipping $file" 1&amp;gt;&amp;amp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; fi&lt;/P&gt;&lt;P&gt;done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If /tmp has subdirectories, there'll be problems.﻿&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2011 12:17:51 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-09-05T12:17:51Z</dc:date>
    <item>
      <title>Script to move old files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5320053#M641993</link>
      <description>&lt;P&gt;I am not too familiar with script , if I want to do the housekeeping in a path as below , can advise what can I do ? Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1) move the files ( /tmp ) elder than 90 days to a specfic path ( /tmp/bak )&lt;/P&gt;&lt;P&gt;2) remove the files elder than 180 days and gzip these remove files in /tmp/bak .&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2011 06:32:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5320053#M641993</guid>
      <dc:creator>2ne1</dc:creator>
      <dc:date>2011-09-02T06:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script to move old files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5320251#M641994</link>
      <description>&lt;P&gt;Take a search the category for previous topics that are similar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;1) move the files (/tmp) older than 90 days to a specific path (/tmp/bak)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find /tmp -mtime +90 -exec mv {} /tmp/bak \;&lt;/P&gt;&lt;P&gt;(If you want to use "-exec ... +, you'll need to write a script that reverse the parms to mv(1).)&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2011 22:31:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5320251#M641994</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-02T22:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script to move old files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5321829#M641995</link>
      <description>&lt;P&gt;Thx reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The command you provided is for request 1 , can advise if I would like to do the thing as point 2 , what can i do ? thx&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2011 07:48:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5321829#M641995</guid>
      <dc:creator>2ne1</dc:creator>
      <dc:date>2011-09-05T07:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script to move old files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5322173#M641996</link>
      <description>&lt;P&gt;&amp;gt;The command you provided is for request 1, can advise if I would like to do the thing as point 2, what can I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea was that you would figure 2) out from the solution to 1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;find /tmp -mtime +180 -type f | while read filename; do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; gzip -c "$file" &amp;gt; "/tmp/bak/$file.gz"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if [ $? -eq 0 ]; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rm -f "$file"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "Problem gzipping $file" 1&amp;gt;&amp;amp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; fi&lt;/P&gt;&lt;P&gt;done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If /tmp has subdirectories, there'll be problems.﻿&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2011 12:17:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-move-old-files/m-p/5322173#M641996</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-05T12:17:51Z</dc:date>
    </item>
  </channel>
</rss>

