cloning system - Unix

This is a discussion on cloning system - Unix ; Hello, I have cloned a solaris system running a proxy application (restored from backup) to another one so that all config files etc are the same. I need to change the hostname and ip of the system The hostname and ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: cloning system

  1. cloning system

    Hello,
    I have cloned a solaris system running a proxy application (restored
    from backup) to another one so that all config files etc are the same.
    I need to change the hostname and ip of the system

    The hostname and ip appear in a lot of configuration files. I want to
    do a find so I can see all the files which contain them to change to
    the new hostname/ip.

    Currently I do a

    grep -l "" `find .` 2> /dev/null

    >From the root dir, which will give me the file the string

    appears in.

    However this takes ages and will search through binary files which I do
    not want to do, is there a quicker way, or a way to sepcify find to
    search ascii or text files only?

    Thanks very much


  2. Re: cloning system

    cconnell_1@lycos.com wrote:
    > Hello,
    > I have cloned a solaris system running a proxy application (restored
    > from backup) to another one so that all config files etc are the same.
    > I need to change the hostname and ip of the system
    >
    > The hostname and ip appear in a lot of configuration files. I want to
    > do a find so I can see all the files which contain them to change to
    > the new hostname/ip.
    >
    > Currently I do a
    >
    > grep -l "" `find .` 2> /dev/null
    >
    >>From the root dir, which will give me the file the string

    > appears in.
    >
    > However this takes ages and will search through binary files which I do
    > not want to do, is there a quicker way, or a way to sepcify find to
    > search ascii or text files only?
    >
    > Thanks very much
    >



    The only way your going to avoid frivolously grepping is to narrow your
    search somehow, either to a certain filename pattern, perhaps, or to
    specific (sub)directories.

    If you're just trying change the hostname you can comb through and
    manually change the hostname in following files and reboot:

    /etc/hosts
    /etc/hostname.
    /etc/net/*/hosts
    /etc/nodename

    'sys-unconfig' will change all that automatically; you'll reconfigure
    the host setup from scratch, hostname, naming services, etc. after
    rebooting. See the manpage before doing that.

    Your app(s) will need to know about the change, most likely. Also, this
    find will do what you were trying above a little more efficiently ...

    find . -type f -exec grep -q {} \;
    -print

+ Reply to Thread