<?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 Delete snapshots via bash and ssh in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455670#M44051</link>
    <description>&lt;P&gt;I am trying to delete close to a hundred snapshots left over from a migration using SVM-DR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have built a file called snaplist that contains:&lt;BR /&gt;vserver volume snapshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then i run a while loop to go through the file:&lt;/P&gt;&lt;P&gt;while read vserv vol snap&lt;/P&gt;&lt;P&gt;do&lt;BR /&gt;ssh -n admin@cluster "set adv -c off ; volume snapshot delete -vserver $vserv -volume $vol -snapshot $snap -force true"; sleep 3; done &amp;lt; snaplist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error when io try to run it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;" is an invalid value for field "-foreground &amp;lt;true|false&amp;gt;"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Valid choices in this command's context: true, false&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;" for parameter "-foreground". A future release may&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;require "-foreground" to be specified before the value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to figure where that's coming from! I'm sure it's something stupid I'm missing!&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 19:39:02 GMT</pubDate>
    <dc:creator>BobMoore</dc:creator>
    <dc:date>2024-10-09T19:39:02Z</dc:date>
    <item>
      <title>Delete snapshots via bash and ssh</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455670#M44051</link>
      <description>&lt;P&gt;I am trying to delete close to a hundred snapshots left over from a migration using SVM-DR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have built a file called snaplist that contains:&lt;BR /&gt;vserver volume snapshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then i run a while loop to go through the file:&lt;/P&gt;&lt;P&gt;while read vserv vol snap&lt;/P&gt;&lt;P&gt;do&lt;BR /&gt;ssh -n admin@cluster "set adv -c off ; volume snapshot delete -vserver $vserv -volume $vol -snapshot $snap -force true"; sleep 3; done &amp;lt; snaplist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error when io try to run it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;" is an invalid value for field "-foreground &amp;lt;true|false&amp;gt;"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Valid choices in this command's context: true, false&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;" for parameter "-foreground". A future release may&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;require "-foreground" to be specified before the value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to figure where that's coming from! I'm sure it's something stupid I'm missing!&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 19:39:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455670#M44051</guid>
      <dc:creator>BobMoore</dc:creator>
      <dc:date>2024-10-09T19:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Delete snapshots via bash and ssh</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455677#M44055</link>
      <description>&lt;P&gt;I think your bash is not interpreting the variables correctly. I would use awk like this;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sanaman_0-1728533468651.png" style="width: 400px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/29173i0EBBF47501DCF7BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sanaman_0-1728533468651.png" alt="Sanaman_0-1728533468651.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 04:11:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455677#M44055</guid>
      <dc:creator>Sanaman</dc:creator>
      <dc:date>2024-10-10T04:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Delete snapshots via bash and ssh</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455694#M44058</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello. This is what I do regarding the virtual environment. How much can I execute this command in your version?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liu_0-1728547402344.png" style="width: 400px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/29182i1E09E3DBC093329A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="liu_0-1728547402344.png" alt="liu_0-1728547402344.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liu_1-1728547418609.png" style="width: 400px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/29183iC9C7043696092132/image-size/medium?v=v2&amp;amp;px=400" role="button" title="liu_1-1728547418609.png" alt="liu_1-1728547418609.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="liu_2-1728547428121.png" style="width: 400px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/29184i44F86E12CA87671D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="liu_2-1728547428121.png" alt="liu_2-1728547428121.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;look this&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.netapp.com/us-en/ontap-cli-96/volume-snapshot-delete.html#description" target="_blank"&gt;volume snapshot delete (netapp.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 08:18:22 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Delete-snapshots-via-bash-and-ssh/m-p/455694#M44058</guid>
      <dc:creator>liu</dc:creator>
      <dc:date>2024-10-10T08:18:22Z</dc:date>
    </item>
  </channel>
</rss>

