LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2003, 08:44 PM   #1
echox
LQ Newbie
 
Registered: Mar 2003
Location: VN
Distribution: Linux7.1,7.3
Posts: 12

Rep: Reputation: 0
run real time


i have a log file and i want read and import to databases mysql on real time because i need newest infomation in log file.
what need i do?
is there a method : file log ---->pipe---->mysql.
 
Old 04-02-2003, 09:59 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Tail, part of the textutils-package from
gnu.org should show nicely how to retrieve
the new lines :)

Cheers,
Tink
 
Old 04-03-2003, 01:27 AM   #3
echox
LQ Newbie
 
Registered: Mar 2003
Location: VN
Distribution: Linux7.1,7.3
Posts: 12

Original Poster
Rep: Reputation: 0
but if use tail, i always check this is a news lines or not and i don't known how many new line!!!
 
Old 04-03-2003, 03:01 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Umm. sorry, misunderstanding here:

I indicated you should get tails source,
and see how they check for growth...

It this seems overkill to you:
One idea would be to just run a loop,
use seekp on a regular (timed) basis
and compare to the previous seekp.
Also check whether the new characters
you get across in the buffer you're reading
into are \0 ... if you encounter a \0, write
to your database and flush the buffer.

Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how can I measure how much real time is used to run an executable? markhod Linux - General 1 04-07-2005 05:41 AM
real time recompiling kris273 Programming 3 08-09-2004 11:12 PM
Real Time Equalizer st00 Linux - Software 1 03-20-2004 07:00 PM
real-time OS h/w Programming 11 01-24-2004 09:28 PM
Real Time Plot... DaFrEQ Linux - Software 0 08-27-2002 09:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:32 PM.

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