The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Switched off of a remote mysql server and need to search the server

Discussion in 'Workarounds and Optimization' started by DWHS.net, Jan 23, 2012.

  1. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Now that we are off of the remote mysql server some accounts might still have the remote IP in some of the scripts.

    Anyone know what search command can search the home directory to see if anyone has the IP still?

    I tried:

    grep -r "66.111.111.111" *

    But it's taking forever and hasn't shown any results.

    Thanks
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could try the following instead, which would be a better way to not miss any possible files:

    Code:
    find /home -type f -print0 | xargs -0 grep -n "66.111.111.111"
    No matter what command you use, a check on all files in /home is going to take awhile.
     
  3. Elfofdark

    Elfofdark Member

    Joined:
    Mar 7, 2007
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Or if you want use just grep hit:

    cd /home
    grep -lir "192.168.1.1" *

    It will return every file that contains ip 192.168.1.1.
    You can use sed to make a find and replace so you don't need edit them automatically.

    It's up to you.
     
Loading...
Similar Threads - Switched off remote
  1. jameshh93
    Replies:
    1
    Views:
    103

Share This Page