LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2005, 11:29 PM   #1
zameer_india
Member
 
Registered: Sep 2004
Location: hyderabad
Posts: 210

Rep: Reputation: 30
regarding "locate" command...


Hi All...
Good Morning ...

When i am trying to locate a file xxxxx from a terminal i got a message like "database /var/lib/slocate/slocate.db' is more than 8 days old" .... i am not able to recognise a problem...

any help would be appreciate....
infact this is the process done so far

[root@redhat zam1]# locate Teradata.pdf
warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
[root@redhat zam1]#

i run "find " command successfullly.... but it takes a long time for searching.... any help would be appreciated...

thnx in Advance...
zameer ahmed syed.
 
Old 01-09-2005, 11:39 PM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
The way 'locate' works is to use a searchable database of the files on your computer - that's how it works so fast. But you have to keep the database up-to-date. To do that, run 'updatedb' as root. To make this happen automatically, you can put a script in /etc/cron.daily that looks like:

Code:
#!/bin/sh
updatedb
Make sure it's executable (chmod +x /etc/cron.daily/updatedb) and it should be run automatically once a day to keep you up to date.
 
Old 01-10-2005, 12:11 AM   #3
zameer_india
Member
 
Registered: Sep 2004
Location: hyderabad
Posts: 210

Original Poster
Rep: Reputation: 30
Thanx Wapcaplet...

U done a gr8 help for me.....now its working fine .... I am having negligible knowledge in script...if u don't mind could you plz tell me how to make it autoupdate (using script) step by step..

iam assumeing like this
i have to make a txt file and write the script which u gave....
then i have to save in which file ????...

ThnQ.....
zameer
 
Old 01-10-2005, 07:16 AM   #4
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Quote:
Originally posted by zameer_india
i have to make a txt file and write the script which u gave....
then i have to save in which file ????...
You can call it anything you like, as long as you save it in the /etc/cron.daily direcctory; saving it as /etc/cron.daily/updatedb would be appropriate.
 
Old 01-10-2005, 07:55 AM   #5
zameer_india
Member
 
Registered: Sep 2004
Location: hyderabad
Posts: 210

Original Poster
Rep: Reputation: 30
THANX WAPCAPLET....
 
Old 01-10-2005, 08:58 AM   #6
titanium_geek
Senior Member
 
Registered: May 2002
Location: Horsham Australia
Distribution: elementary os 5.1
Posts: 2,479

Rep: Reputation: 50
you know, cron was one of the things I struggled with a couple of years ago. Gave up. This looks way easier.

THANKS WAPCAPLET!

titanium_geek
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
A few annoying problems; Cannot locate theme & "No DFP detected". Ninja Cow Slackware 0 04-29-2004 12:01 AM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM
Can't locate object method "splitpath" via package "File::Spec" RobJohnston Linux - General 2 06-28-2003 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration