Subscribe
Accepted Solution

wrfile

I am new to this netapp and like to edit host, snapmirror.conf files ect.

I like to use wrfile -a option becuase I can do one line at a time and it is safe.

How do I delete a line incase if it is wrong line?

For an example line 10 is rong and want to delete?

Can i do that using wrfile?

I noticed that I can access to those file using cifs share.

I read few people say that we can use text editor,

if i open that using text editor,What do i do after editing that , just click on save?

I will appreciate if you can help me on this.

Re: wrfile

Hey Ratnathurai,

you ceertainly are able to edit the files by browsing to the CIFS share. open the file you want to edit with a text editor, modify the file and then save it back to its original location. ( I would recommend creating a copy of the original file before modifying it in case something goes wrong.)

Also, you can use rdfile at the command line to get a print out of the file you are looking to edit, copy the file output, edit it any way you like, and the use the wrfile command without any flags to copy the entire edited file back in place. (doing this will essentially replace the entire file though, and that can be dangerous if you are not careful. again, be sure you have a copy of the original.)

Cheers!

Re: wrfile

I have a backup.

Can I overwite the file in case if i made mistake.

for an example. copy and paste it to /etc/ ?

will it overwite the file?

Re: wrfile

Yes, for example:

If you want to change the /etc/rc file, open that file with a text editor and make your changes.

Then save the file as /etc/rc which will overwrite the existing file and the next time you reboot (takeover/giveback) the controller will boot off that file and adopt it's new config.

You can run the commands manually at the command line to avoid a reboot.

you can also pre-create the files from scratch and then just copy/replace the file into the correct /etc/xxx location. (be sure to overwrite the old file by using the exact same file name.)