<?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: how to use xcp -match options to only copy files from a given month of a given year in Ask The Experts</title>
    <link>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144501#M84</link>
    <description>&lt;P&gt;i received this from another source:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok, then you should try something like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;xcp copy -match “created &amp;lt; 1*year” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;xcp copy -match “modified &amp;lt; 1*year” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;“*year” can be changed with any other period of time (hour, day, month, year)&lt;/LI&gt;
&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The given examples can be combined to a single command to filter the files created and modified in the same time.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;xcp copy -match “created &amp;lt; 1*year and modified &amp;lt; 1*year” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;if you want to find more details about how to use the match filter please run “xcp help -match” command.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 23:21:51 GMT</pubDate>
    <dc:creator>robh-at-work</dc:creator>
    <dc:date>2018-11-06T23:21:51Z</dc:date>
    <item>
      <title>how to use xcp -match options to only copy files from a given month of a given year</title>
      <link>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144439#M80</link>
      <description>&lt;DIV&gt;i am migrating a large number of small files (10 million) and the business unit wants them in sub-folders 201701, 201702, 201703..... currently there in 3 massive directories on several different servers with no folder structure. The file names do not have a &lt;SPAN class="st"&gt;&lt;EM&gt;disernalable&lt;/EM&gt;&lt;/SPAN&gt; pattern that could be used to sort them.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;i am not a programmer so the -match options are a bit vague for me. All i need to see is an Example of setting up a date range. &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;xcp copy -match (files from 01 2017) \\restore1\source \\netapp\destination\201701&lt;/DIV&gt;
&lt;DIV&gt;i found this for power shell&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Get-ChildItem | Where-Object {$_.LastWriteTime -gt '10/1/18' -and $_.LastWriteTime -lt '11/1/18'} | foreach {Copy-Item -Path $_.filename -Destination .\201810\}&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Nov 2018 00:49:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144439#M80</guid>
      <dc:creator>robh-at-work</dc:creator>
      <dc:date>2018-11-06T00:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to use xcp -match options to only copy files from a given month of a given year</title>
      <link>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144501#M84</link>
      <description>&lt;P&gt;i received this from another source:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok, then you should try something like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;xcp copy -match “created &amp;lt; 1*year” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;xcp copy -match “modified &amp;lt; 1*year” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;“*year” can be changed with any other period of time (hour, day, month, year)&lt;/LI&gt;
&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The given examples can be combined to a single command to filter the files created and modified in the same time.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;xcp copy -match “created &amp;lt; 1*year and modified &amp;lt; 1*year” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;if you want to find more details about how to use the match filter please run “xcp help -match” command.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 23:21:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144501#M84</guid>
      <dc:creator>robh-at-work</dc:creator>
      <dc:date>2018-11-06T23:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to use xcp -match options to only copy files from a given month of a given year</title>
      <link>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144503#M85</link>
      <description>&lt;P&gt;to all who read this:&lt;/P&gt;
&lt;P&gt;yes i ran the xcp help -match command and after reading the help output i'm still didn't gain the knowledge to use what i read.&lt;/P&gt;
&lt;P&gt;However the examples provided did give rise to,&amp;nbsp; 2 more questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;what is value of the 1* in: &lt;STRONG&gt;xcp copy -match “created &amp;lt; 1*year” &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;what needs to be changed to make this a correct -match statement?
&lt;P&gt;&lt;STRONG&gt;xcp copy –match “created &amp;nbsp;= 2017year and &amp;gt; 2month and &amp;lt; 3month” &amp;lt;source&amp;gt; &amp;lt;target&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;looking for files created feb. 2017 and what if i was looking for feb 2015.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 23:47:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/144503#M85</guid>
      <dc:creator>robh-at-work</dc:creator>
      <dc:date>2018-11-06T23:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to use xcp -match options to only copy files from a given month of a given year</title>
      <link>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/151707#M1073</link>
      <description>&lt;P&gt;while I can get date components to work fine, I can't access any time components for match.&amp;nbsp; I get name 'hour' is not defined etc..., I used modified and mtime...&amp;nbsp; Was trying to setup a precopy of data without running into a file being activiely written to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xcp copy -match "mtime&amp;gt;1*hour" &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error: Error evaluating expression "mtime&amp;gt;1*hour": name 'hour' is not defined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tried every varation of hour that I could think of as well.&amp;nbsp; Is there some fmt(iso(mtime)) required?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 22:42:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Ask-The-Experts/how-to-use-xcp-match-options-to-only-copy-files-from-a-given-month-of-a-given/m-p/151707#M1073</guid>
      <dc:creator>MStubbs</dc:creator>
      <dc:date>2019-10-13T22:42:05Z</dc:date>
    </item>
  </channel>
</rss>

