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.

Locate Function via SSH.

Discussion in 'General Discussion' started by moogle, Sep 2, 2003.

  1. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    When I try to loacte a file I get this error:


    root@server [~]# locate file.php
    locate: /usr/local/var/locatedb: No such file or directory


    From looking, that doesn't appear to be where locate is. I'm not sure if it changed or the server got mixed up somehow, but I need to know where locate is and how to tell the server to look for it in the correct place.

    cPanel.net Support Ticket Number:
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    You should try using slocate instead. If you get an error along the same lines, you will need to run updatedb prior to using slocate.

    cPanel.net Support Ticket Number:
     
  3. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    root@server [/]# slocate file.php
    bash: /usr/bin/slocate: Permission denied

    cPanel.net Support Ticket Number:
     
  4. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Are you a cpanel user or cpanel system admin?

    cPanel.net Support Ticket Number:
     
  5. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Admin. This is with root access.

    cPanel.net Support Ticket Number:
     
  6. carluk

    carluk Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    162
    Likes Received:
    0
    Trophy Points:
    16
    ls -l /usr/bin/slocate

    cPanel.net Support Ticket Number:
     
  7. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    chmod 755 /usr/bin/slocate

    Then try again.

    cPanel.net Support Ticket Number:
     
  8. moogle

    moogle Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    root@server [~]# chmod 755 /usr/bin/slocate
    root@server [~]# locate file.php
    locate: /usr/local/var/locatedb: No such file or directory

    cPanel.net Support Ticket Number:
     
  9. carluk

    carluk Well-Known Member

    Joined:
    Sep 2, 2003
    Messages:
    162
    Likes Received:
    0
    Trophy Points:
    16
    do this

    ls -l /usr/bin/slocate

    Copy and paste what it outputs.

    cPanel.net Support Ticket Number:
     
  10. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    Use slocate on the command line...not locate.

    cPanel.net Support Ticket Number:
     
  11. pirania1

    pirania1 Well-Known Member

    Joined:
    May 10, 2003
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Miami, FL
    This will update/create the database:
    Code:
    locate -u 
    It should be in your nightly cron (was by default on my server)

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page