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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Good way to write to a database continuly

Status
Not open for further replies.

Larshg

Programmer
Mar 1, 2001
187
DK
Hi

I want to put the output from
wmstat -w 5
into a database as the command runs - I have this script that right now puts the data into a file.
HOST=`hostname -s`

while [ : ]
do
echo `date +"%d%m%y-%H:%M:%S"` " " `/usr/bin/vmstat -w 1 2|tail -1` >> /home/nmsuser/scripts/log/vmstat_$HOST.log
sleep 10
done

But insted of sending the output into a file - I would like it to go ino a database.

/Larshg
 
what DB?
If Oracle, 'man sqlldr'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
You can pipe (|) an insert into table command with the appropriate data into the appropriate db processor, for INFORMIX - dbaccess.
mysql uses the command mysql.
 
Its an ORACLE database

>man sqlldr
No reference page found for sqlldr.

My system does not contain man pages for this one.

Does anyone know where I can find thise man pages?

/Larshg
 
Perhaps posting in an Oracle forum ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I think that isql is the interactive interface, just pipe your info to isql.
 


echo "insert into table values "`date +"%d%m%y-%H:%M:%S"` " " `/usr/bin/vmstat -w 1 2|tail -1` | isql

not correct syntax, but you should get the idea. isql may need the dbname as a parm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top