Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Schedule Auto Import new Log / Text Files into MySQL

Status
Not open for further replies.

newprog1

Technical User
Jan 7, 2006
3
GB
Hi Everyone,

Problem:

Basically we have a SQL Server Database on our telecoms switch, to which under the maintenance contract we have no direct access. Every 15 mins log files are downloaded in *.log files (text files) which contain data we can upload to our own databases for querying. The log files are on an ftp server and the filenames comprise of date and time of dumps.

Requirement :

In short I would like to know the best way to automatically update tables on a MySQL database with the new log files as they appear or if there is some existing software which allows this type of schedule and auto import. I would be very greatful if someone can give me some ideas with this problem as it would save me so much time and I am most familiar with mySql and Sql Server databases and would appreciate help in either database.



Thanks in advance :)
 
You can import delimited text files into a MySQL database by using the LOAD DATA command which is explained in the manual. This could be executed via the command-line, using the "mysql" client program.

As for automatically loading the files when they appear, the only way that could be done would be to have a scheduled job run every so often (a shell script would probably do), or have a program running constantly which would check for the file every so often.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top