<?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: Function / command to append data to config files (rc, hosts...)? in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54698#M11370</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's my final one that works in a workflow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;P&gt;param (&lt;/P&gt;&lt;P&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="Array name or IP address")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$Array,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="Full path to filer or vfiler requested file, example: hosts")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$FilePath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="New Line to enter to the configuration file. One line at a time.")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$LineEntered&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# connect to controller&lt;/P&gt;&lt;P&gt;Connect-WfaController -Array $Array &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$rootvol=Get-NaVolRoot&lt;/P&gt;&lt;P&gt;$fullpath="/vol/" + $rootvol.Name + "/etc/" + $FilePath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Write the line to the file.&lt;/P&gt;&lt;P&gt;Write-NaFile -Path $fullpath -Append -Data $("`n" + "$LineEntered" + "`n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; # End of Command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Dec 2013 15:08:12 GMT</pubDate>
    <dc:creator>solal</dc:creator>
    <dc:date>2013-12-09T15:08:12Z</dc:date>
    <item>
      <title>Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54672#M11360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you aware of / used before a function or command to append new data to configuration files (i.e &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;like /etc/usermap.cfg and /etc/passwd&lt;/SPAN&gt;) in WFA?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Solal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 10:47:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54672#M11360</guid>
      <dc:creator>solal</dc:creator>
      <dc:date>2013-12-05T10:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54677#M11362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Solal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can you elaborate on what you are trying to do and why you need this ? This may help understand the need better and propose other solutions as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;adai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 11:10:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54677#M11362</guid>
      <dc:creator>adaikkap</dc:creator>
      <dc:date>2013-12-05T11:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54682#M11364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a command to add an SSH publickey to a 7 Mode storage system, and I used API calls that just append to a file to get this done:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.netapp.com/docs/DOC-29903" target="_blank"&gt;https://communities.netapp.com/docs/DOC-29903&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could copy the above command and modify it to meet your needs.&amp;nbsp; Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 15:36:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54682#M11364</guid>
      <dc:creator>arndt</dc:creator>
      <dc:date>2013-12-05T15:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54689#M11367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got another example from Anatoly that really helped as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;You can use ONTAP toolkit cmdlets &lt;EM&gt;Read-NcDirectory,&lt;/EM&gt; &lt;EM&gt;Read-NcFile&lt;/EM&gt;, &lt;EM&gt;Write-NcFile&lt;/EM&gt; inside the command in WFA in order to do it &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;# connect to controller&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;Get-WFALogger -Info -message $("Connecting to " + $Cluster)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;Connect-WfaCluster $Cluster&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;Read-NcDirectory -Path /vol/vs1_root/.vsadmin/config/etc -VserverContext vs1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;Read-NcFile -Path /vol/vs1_root/.vsadmin/config/etc/master.passwd -VserverContext vs1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;$data = "nobody2:*:65535:65535::::::"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #c00000;"&gt;Write-NcFile -Path /vol/vs1_root/.vsadmin/config/etc/master.passwd -Data $data -Append -VserverContext vs1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 15:45:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54689#M11367</guid>
      <dc:creator>solal</dc:creator>
      <dc:date>2013-12-05T15:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54693#M11369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing Solal. Very useful information. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 16:12:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54693#M11369</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2013-12-05T16:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54698#M11370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's my final one that works in a workflow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;P&gt;param (&lt;/P&gt;&lt;P&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="Array name or IP address")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$Array,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="Full path to filer or vfiler requested file, example: hosts")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$FilePath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [parameter(Mandatory=$true, HelpMessage="New Line to enter to the configuration file. One line at a time.")]&lt;/P&gt;&lt;P&gt;&amp;nbsp; [string]$LineEntered&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# connect to controller&lt;/P&gt;&lt;P&gt;Connect-WfaController -Array $Array &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$rootvol=Get-NaVolRoot&lt;/P&gt;&lt;P&gt;$fullpath="/vol/" + $rootvol.Name + "/etc/" + $FilePath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Write the line to the file.&lt;/P&gt;&lt;P&gt;Write-NaFile -Path $fullpath -Append -Data $("`n" + "$LineEntered" + "`n")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; # End of Command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 15:08:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/54698#M11370</guid>
      <dc:creator>solal</dc:creator>
      <dc:date>2013-12-09T15:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function / command to append data to config files (rc, hosts...)?</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/110182#M19448</link>
      <description>&lt;P&gt;Hi Solal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to append data in configuration files like as /etc/rc, /etc/hosts, /etc/exports...etc,&amp;nbsp;&amp;nbsp;&amp;nbsp; i am trying to go through your attachment but it is not opening .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So please tell me how can i append data in files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any command for copying and creating files and directories like as cp and mkdir?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 08:01:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Function-command-to-append-data-to-config-files-rc-hosts/m-p/110182#M19448</guid>
      <dc:creator>Vinu</dc:creator>
      <dc:date>2015-09-25T08:01:04Z</dc:date>
    </item>
  </channel>
</rss>

