<?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: Delete files automatically older than 90 days in General Discussion</title>
    <link>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443819#M1502</link>
    <description>&lt;P&gt;Following is very basic example: (This will return snapshots more than 90 days old across cluster)&lt;/P&gt;&lt;P&gt;PS C:\Users\Administrator&amp;gt; Get-NcSnapshot |?{ $_.Created -lt (Get-Date).AddDays(-90)}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending upon result, If you want to delete those snaps (older than 90 days), then you need to use 'remove-nscsnapshot' api, and if you don't want confirmation for each snap, simply add $flase:&lt;/P&gt;&lt;P&gt;PS C:\Users\Administrator&amp;gt; Get-NcSnapshot |?{ $_.Created -lt (Get-Date).AddDays(-90)} | remove-ncsnapshot -Confirm:$false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Side note: "remove-ncsnapshot" works in SVM context. So you need to make sure, you have connected to SVM before you can run that command, else it will complain APINOTFOUND.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex-&lt;/P&gt;&lt;P&gt;PS C:\Users\Administrator&amp;gt; Connect-NcController [SVM_mgmt_IP], not Cluster_Mgmt_IP.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Apr 2023 14:01:31 GMT</pubDate>
    <dc:creator>Ontapforrum</dc:creator>
    <dc:date>2023-04-27T14:01:31Z</dc:date>
    <item>
      <title>Delete files automatically older than 90 days</title>
      <link>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443744#M1500</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a script or Cronjob command that I can execute that will delete files automatically that is older than 90 days. I have a few CIFS/SMB Shares created in NetApp ONTAP 9 (Model AFF a250) that are published to windows clients via Group Policy.&amp;nbsp; Is this something that can be configured on the volume level? Can't seem to find a KB Article on this topic.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:49:54 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443744#M1500</guid>
      <dc:creator>Palmer01</dc:creator>
      <dc:date>2025-06-04T09:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Delete files automatically older than 90 days</title>
      <link>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443806#M1501</link>
      <description>&lt;P&gt;You have to use your own script from the&amp;nbsp; Host-side, or any 3rd party tool to identify 'files' (names). However, you can definitely identify the snapshots that are older than 90 days. If you look up, you might find the ready script in one of our community threads. This script can be scheduled to run as cron or Windows task manager task.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 09:07:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443806#M1501</guid>
      <dc:creator>Ontapforrum</dc:creator>
      <dc:date>2023-04-27T09:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Delete files automatically older than 90 days</title>
      <link>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443819#M1502</link>
      <description>&lt;P&gt;Following is very basic example: (This will return snapshots more than 90 days old across cluster)&lt;/P&gt;&lt;P&gt;PS C:\Users\Administrator&amp;gt; Get-NcSnapshot |?{ $_.Created -lt (Get-Date).AddDays(-90)}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending upon result, If you want to delete those snaps (older than 90 days), then you need to use 'remove-nscsnapshot' api, and if you don't want confirmation for each snap, simply add $flase:&lt;/P&gt;&lt;P&gt;PS C:\Users\Administrator&amp;gt; Get-NcSnapshot |?{ $_.Created -lt (Get-Date).AddDays(-90)} | remove-ncsnapshot -Confirm:$false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Side note: "remove-ncsnapshot" works in SVM context. So you need to make sure, you have connected to SVM before you can run that command, else it will complain APINOTFOUND.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex-&lt;/P&gt;&lt;P&gt;PS C:\Users\Administrator&amp;gt; Connect-NcController [SVM_mgmt_IP], not Cluster_Mgmt_IP.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:01:31 GMT</pubDate>
      <guid>https://community.netapp.com/t5/General-Discussion/Delete-files-automatically-older-than-90-days/m-p/443819#M1502</guid>
      <dc:creator>Ontapforrum</dc:creator>
      <dc:date>2023-04-27T14:01:31Z</dc:date>
    </item>
  </channel>
</rss>

