<?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: basic script (for you guys anyway!) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714741#M61463</link>
    <description>Sorry comment is in the wrong place.&lt;BR /&gt;&lt;BR /&gt;--------------------&lt;BR /&gt;&lt;BR /&gt;#delete .dbf files over 7 days old&lt;BR /&gt;&lt;BR /&gt;find . -name "*.dbf" -mtime +7 -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;#if .dbf files exist gzip them and mail dir listing to a user&lt;BR /&gt;&lt;BR /&gt;test -f *.dbf&lt;BR /&gt;&lt;BR /&gt;if [[ $? = 0 ]]&lt;BR /&gt;then&lt;BR /&gt;for i in $(ls -1 *.dbf)&lt;BR /&gt;do&lt;BR /&gt;gzip $i&lt;BR /&gt;done&lt;BR /&gt;ls -la /directory | mailx -s "files are" username@domain.com&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;---------------&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
    <pubDate>Wed, 01 May 2002 12:28:18 GMT</pubDate>
    <dc:creator>David Burgess</dc:creator>
    <dc:date>2002-05-01T12:28:18Z</dc:date>
    <item>
      <title>basic script (for you guys anyway!)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714738#M61460</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a list of .dbf files in a directory, that I would like to 'gzip' up, depending on their date.&lt;BR /&gt;&lt;BR /&gt;At the moment I run:&lt;BR /&gt;&lt;BR /&gt;for i in `ls -1 |grep _1`&lt;BR /&gt;do&lt;BR /&gt;gzip $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This will zip any files with _1 in the name.&lt;BR /&gt;&lt;BR /&gt;I would like to keep the last 7 days files, so need to use the find command I guess, with -mtime to search for files greater than 10days (ignoring the . &amp;amp; .. entries, and the one .conf file in the list) and gzip them, then maybe report what it's done to an email address... only if it's had to gzip something... if no work had to be done.. no email is sent.&lt;BR /&gt;&lt;BR /&gt;thanks eveyone..&lt;BR /&gt;&lt;BR /&gt;Nik&lt;BR /&gt;btw: I'm still working on it now... but I'm sure someone will have a clever 2 liner that'll do it in half the time!</description>
      <pubDate>Wed, 01 May 2002 12:06:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714738#M61460</guid>
      <dc:creator>Nik_1</dc:creator>
      <dc:date>2002-05-01T12:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: basic script (for you guys anyway!)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714739#M61461</link>
      <description>Hi Nik:&lt;BR /&gt;&lt;BR /&gt;You are on the right track, keep scripting!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 01 May 2002 12:10:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714739#M61461</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-05-01T12:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: basic script (for you guys anyway!)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714740#M61462</link>
      <description>Nik,&lt;BR /&gt;&lt;BR /&gt;This should help you on your way&lt;BR /&gt;&lt;BR /&gt;---------------&lt;BR /&gt;&lt;BR /&gt;#delete .dbf files over 7 days old&lt;BR /&gt;&lt;BR /&gt;find . -name "*.dbf" -mtime +7 -exec rm -f {} \;&lt;BR /&gt;test -f *.dbf&lt;BR /&gt;&lt;BR /&gt;#if .dbf files exist gzip them and mail dir listing to a user&lt;BR /&gt;&lt;BR /&gt;if [[ $? = 0 ]]&lt;BR /&gt;then&lt;BR /&gt;for i in $(ls -1 *.dbf)&lt;BR /&gt;do&lt;BR /&gt;gzip $i&lt;BR /&gt;done&lt;BR /&gt;ls -la /directory | mailx -s "files are" username@domain.com&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;----------------&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Wed, 01 May 2002 12:25:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714740#M61462</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2002-05-01T12:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: basic script (for you guys anyway!)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714741#M61463</link>
      <description>Sorry comment is in the wrong place.&lt;BR /&gt;&lt;BR /&gt;--------------------&lt;BR /&gt;&lt;BR /&gt;#delete .dbf files over 7 days old&lt;BR /&gt;&lt;BR /&gt;find . -name "*.dbf" -mtime +7 -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;#if .dbf files exist gzip them and mail dir listing to a user&lt;BR /&gt;&lt;BR /&gt;test -f *.dbf&lt;BR /&gt;&lt;BR /&gt;if [[ $? = 0 ]]&lt;BR /&gt;then&lt;BR /&gt;for i in $(ls -1 *.dbf)&lt;BR /&gt;do&lt;BR /&gt;gzip $i&lt;BR /&gt;done&lt;BR /&gt;ls -la /directory | mailx -s "files are" username@domain.com&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;---------------&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Wed, 01 May 2002 12:28:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714741#M61463</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2002-05-01T12:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: basic script (for you guys anyway!)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714742#M61464</link>
      <description>Thanks David... have assigned points as appropriate.&lt;BR /&gt;&lt;BR /&gt;James: thanks for the motivational reply! I would assign points, but 20,000(!) I figure you have enough already! :)</description>
      <pubDate>Wed, 01 May 2002 12:32:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/basic-script-for-you-guys-anyway/m-p/2714742#M61464</guid>
      <dc:creator>Nik_1</dc:creator>
      <dc:date>2002-05-01T12:32:27Z</dc:date>
    </item>
  </channel>
</rss>

