<?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: Moving files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793996#M80478</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In order to preserve all file times you could do a cp(1) / rm(1) command pair instead of a mv.  This is of course much slower than using mv(1) but nothing else needs to be done.&lt;BR /&gt;&lt;BR /&gt;Of course you will need the -p option of the cp(1) command (i.e. preserve file times and ownership).&lt;BR /&gt;&lt;BR /&gt;Die captive, or just live,&lt;BR /&gt;Timo</description>
    <pubDate>Mon, 02 Sep 2002 08:58:29 GMT</pubDate>
    <dc:creator>Timo Ruiter</dc:creator>
    <dc:date>2002-09-02T08:58:29Z</dc:date>
    <item>
      <title>Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793990#M80472</link>
      <description>i Need to move files into sub folders by date time stamp is that posible. im running HPUX 11.11&lt;BR /&gt;&lt;BR /&gt;I have thousands of files in one directory, and i want to sort them by month in sub folders to that its a little easyer on the eye's, can anyone help me ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 26 Aug 2002 12:41:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793990#M80472</guid>
      <dc:creator>bbutler3295_1</dc:creator>
      <dc:date>2002-08-26T12:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793991#M80473</link>
      <description>You can do a find command with cpio:&lt;BR /&gt;# cd dir_name&lt;BR /&gt;# find . -depth -atime +10 | cpio -pdlmuva /dest_dir&lt;BR /&gt;&lt;BR /&gt;This will copy all directories  and files under dir_name which was not accessed for last 10 days to the dest_dir&lt;BR /&gt;&lt;BR /&gt;For sorting, you can use sort command:&lt;BR /&gt;# man sort</description>
      <pubDate>Mon, 26 Aug 2002 12:49:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793991#M80473</guid>
      <dc:creator>Sajid_1</dc:creator>
      <dc:date>2002-08-26T12:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793992#M80474</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;there is a one more way&lt;BR /&gt;&lt;BR /&gt;cd / test ( direcorty where you ahve files ) &lt;BR /&gt;&lt;BR /&gt;where you have the files &lt;BR /&gt;&lt;BR /&gt;ls -l | awk '{id ($6=="Jan") print $NF }' &amp;gt; January&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and so on till you get 12 files with the file names of each month , at this point you can check the total sum to ensure u got everything.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;now run the following &lt;BR /&gt;&lt;BR /&gt;for i in Jan Feb Mar Apr .....&lt;BR /&gt;do&lt;BR /&gt;mkdir $i02&lt;BR /&gt;cat $i | while read file_name&lt;BR /&gt;do&lt;BR /&gt;cp /test/filename /test/$i02/&lt;BR /&gt;done&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;you will definately  have to test it ,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Mon, 26 Aug 2002 13:08:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793992#M80474</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-08-26T13:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793993#M80475</link>
      <description>Here is a perl routine that will look at all files under the current directory and will create a subdirectory (if not already created) based on the month of the modification time of the file and then move the file to that subdirectory.&lt;BR /&gt;&lt;BR /&gt;@mths=qw/jan feb mar apr may jun jul aug sep oct nov dev/;&lt;BR /&gt;opendir(DIR,".");&lt;BR /&gt;while($fn=readdir(DIR)) {&lt;BR /&gt; next unless -f $fn;&lt;BR /&gt; ($mtime)=(stat $fn)[9];&lt;BR /&gt; ($mthn)=(localtime($mtime))[4];&lt;BR /&gt; $mth=$mths[$mthn];&lt;BR /&gt; mkdir $mth,0777 unless -e $mth;&lt;BR /&gt; die "$mth is not a directory" unless -d $mth;&lt;BR /&gt; system("mv $fn $mth");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Hope this helps...&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 26 Aug 2002 13:33:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793993#M80475</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-08-26T13:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793994#M80476</link>
      <description># rm /tmp/olderthan                                                &lt;BR /&gt;# touch -m -t 200208031230.01 /tmp/olderthan                         &lt;BR /&gt;# ls -l /tmp/olderthan                                             &lt;BR /&gt;-rw-rw-rw-   1 root       sys              0 Aug  3 12:30 /tmp/olderthan&lt;BR /&gt;# find /tmp ! -newer /tmp/olderthan -exec mv {} /newdirectorypath \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;TOUCH format&lt;BR /&gt;&lt;BR /&gt;YYYYMMDDHHMM.SS&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 26 Aug 2002 13:36:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793994#M80476</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-26T13:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793995#M80477</link>
      <description>One thing that you do need to make a decision on is which timestamp. mtime - time of last file contents modification? atime - time of last file access? or ctime - time of last inode change (chmod, chown)? You should be aware that there is no way to know (except by accident) when a file was created. That data is not carried in the inode.&lt;BR /&gt;&lt;BR /&gt;After you move the file, you probably want to do a touch so that the original datestamps are preserved.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Aug 2002 14:42:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793995#M80477</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-26T14:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793996#M80478</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In order to preserve all file times you could do a cp(1) / rm(1) command pair instead of a mv.  This is of course much slower than using mv(1) but nothing else needs to be done.&lt;BR /&gt;&lt;BR /&gt;Of course you will need the -p option of the cp(1) command (i.e. preserve file times and ownership).&lt;BR /&gt;&lt;BR /&gt;Die captive, or just live,&lt;BR /&gt;Timo</description>
      <pubDate>Mon, 02 Sep 2002 08:58:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793996#M80478</guid>
      <dc:creator>Timo Ruiter</dc:creator>
      <dc:date>2002-09-02T08:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Moving files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793997#M80479</link>
      <description>Timo,&lt;BR /&gt;&lt;BR /&gt;"mv" will preserve times, see below:&lt;BR /&gt;&lt;BR /&gt;# ls -l sd_ipd_acl.2096&lt;BR /&gt;-rw-r--r--   1 root       sys             55 Dec 12  2001 sd_ipd_acl.2096&lt;BR /&gt;# mv sd_ipd_acl.2096 abc&lt;BR /&gt;# mv abc sd_ipd_acl.2096&lt;BR /&gt;# ls -l sd_ipd_acl.2096&lt;BR /&gt;-rw-r--r--   1 root       sys             55 Dec 12  2001 sd_ipd_acl.2096&lt;BR /&gt;# mv sd_ipd_acl.2096 /var&lt;BR /&gt;# mv /var/sd_ipd_acl.2096 /tmp&lt;BR /&gt;# ls -l sd_ipd_acl.2096&lt;BR /&gt;-rw-r--r--   1 root       sys             55 Dec 12  2001 sd_ipd_acl.2096&lt;BR /&gt;# ls -la sd_ipd_acl.2096&lt;BR /&gt;-rw-r--r--   1 root       sys             55 Dec 12  2001 sd_ipd_acl.2096&lt;BR /&gt;# ls -lu sd_ipd_acl.2096&lt;BR /&gt;-rw-r--r--   1 root       sys             55 Sep  2 06:23 sd_ipd_acl.2096&lt;BR /&gt;# date&lt;BR /&gt;Mon Sep  2 06:40:13 EDT 2002&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 02 Sep 2002 09:50:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/moving-files/m-p/2793997#M80479</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-02T09:50:03Z</dc:date>
    </item>
  </channel>
</rss>

