<?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 backup few files from one directory script required. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234568#M676643</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to backup only few files from one directory to another on the same box based on date when files were created. &lt;BR /&gt;&lt;BR /&gt;Scenario:&lt;BR /&gt;&lt;BR /&gt;I have some logs file which overwrite on daily basis and I want to take backup using tar or zip on same machine before overwrite. But the issue is there are many other logs which are normally not in active condition, and I don’t want to take backup of these logs.&lt;BR /&gt;&lt;BR /&gt;I really appreciated if someone shares with me the Script, to sort the logs by date and take backup of latest logs.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance &lt;BR /&gt;Khalid&lt;BR /&gt;</description>
    <pubDate>Mon, 12 Apr 2010 04:23:35 GMT</pubDate>
    <dc:creator>Khalid Shakoor</dc:creator>
    <dc:date>2010-04-12T04:23:35Z</dc:date>
    <item>
      <title>backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234568#M676643</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to backup only few files from one directory to another on the same box based on date when files were created. &lt;BR /&gt;&lt;BR /&gt;Scenario:&lt;BR /&gt;&lt;BR /&gt;I have some logs file which overwrite on daily basis and I want to take backup using tar or zip on same machine before overwrite. But the issue is there are many other logs which are normally not in active condition, and I don’t want to take backup of these logs.&lt;BR /&gt;&lt;BR /&gt;I really appreciated if someone shares with me the Script, to sort the logs by date and take backup of latest logs.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance &lt;BR /&gt;Khalid&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 04:23:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234568#M676643</guid>
      <dc:creator>Khalid Shakoor</dc:creator>
      <dc:date>2010-04-12T04:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234569#M676644</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;If your logs are overwritten on daily basis, you could use a cron job to tar/gzip that log files on another location.&lt;BR /&gt;&lt;BR /&gt;Assuming that your logs are named like this: *.log, and you are using sh as your shell, you can use something like this to sort the logs by date:&lt;BR /&gt;&lt;BR /&gt;set -A SAVEDSET `ls -t *.log`&lt;BR /&gt;&lt;BR /&gt;You can access the items from SAVEDSET (contain the file names) with: &lt;BR /&gt;&lt;BR /&gt;${SAVEDSET[&lt;INDEX_NUMBER&gt;]} &lt;BR /&gt;&lt;BR /&gt;in a while loop.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Horia.&lt;/INDEX_NUMBER&gt;</description>
      <pubDate>Mon, 12 Apr 2010 04:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234569#M676644</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-04-12T04:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234570#M676645</link>
      <description>I think you can write the crontab, which would tar and zip ur log file before ur log files going to be overwrite.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=938732" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=938732&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;may help.&lt;BR /&gt;&lt;BR /&gt;BR,&lt;BR /&gt;Kapil+&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2010 05:11:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234570#M676645</guid>
      <dc:creator>Kapil Jha</dc:creator>
      <dc:date>2010-04-12T05:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234571#M676646</link>
      <description>Hi Horia,&lt;BR /&gt;&lt;BR /&gt;Can you please share with me any example,or script?&lt;BR /&gt;Actually i have not good knowledge of scripting.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 12 Apr 2010 08:07:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234571#M676646</guid>
      <dc:creator>Khalid Shakoor</dc:creator>
      <dc:date>2010-04-12T08:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234572#M676647</link>
      <description>&amp;gt;based on date when files were created.&lt;BR /&gt;&lt;BR /&gt;This info isn't available, unless encoded in the filename.  The best you can do is look at the modification date or possibly the contents of each file.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;backup only few file&lt;BR /&gt;&lt;BR /&gt;Is there a particular name/suffix for each?  How many files would be in the directory?  (If too many, you would have to use find(1) vs ls(1) or use ls(1) and grep.)</description>
      <pubDate>Mon, 12 Apr 2010 14:50:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234572#M676647</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-04-12T14:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234573#M676648</link>
      <description>Hi Khalid:&lt;BR /&gt;&lt;BR /&gt;One option could be to cron a script daily which does something like:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;REF=/tmp/refpoint&lt;BR /&gt;touch -amt $(date "+%m%d"0000) ${REF}&lt;BR /&gt;cd /path || exit&lt;BR /&gt;FILES=$(find . -xdev -type f -newer  ${REF})&lt;BR /&gt;tar -cvf /tmp/MYARCHIVE ${FILES}&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;This creates a reference file whose mtime is that of the current day at 00:00 hours.  You then 'cd' to the directory containing the files you want to collect.  The 'find()' looks for files modified since the day's beginning and 'tar's then into a tarball of you choice.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 12 Apr 2010 16:42:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234573#M676648</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-04-12T16:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234574#M676649</link>
      <description>Hello, Khalid&lt;BR /&gt;&lt;BR /&gt;Please pay attention to Dennis about date of creation. You only can access the time when the file was last modified.&lt;BR /&gt;&lt;BR /&gt;ls -t sort the files by time modified (latest first) before sorting alphabetically.&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Tue, 13 Apr 2010 04:48:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234574#M676649</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-04-13T04:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: backup few files from one directory script required.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234575#M676650</link>
      <description>Thanks&lt;BR /&gt;&lt;BR /&gt;Khalid</description>
      <pubDate>Tue, 08 Jun 2010 08:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/backup-few-files-from-one-directory-script-required/m-p/5234575#M676650</guid>
      <dc:creator>Khalid Shakoor</dc:creator>
      <dc:date>2010-06-08T08:09:39Z</dc:date>
    </item>
  </channel>
</rss>

