shell 脚本输出的系统信息写入mysql数据库

来源:互联网 发布:手机对比软件 编辑:程序博客网 时间:2024/05/23 00:32


mysql>create table kk(Amount int,IPAddress varchar(20),InsertDatetime timestamp default current_timestamp);mysql>load data local infile "/root/aa" into table kk fields terminated by ' ';#################################!/bin/shnetstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | awk '{if($1 > 1) print $1,$2}' > /root/aainscript="load data local infile '/root/aa' into table kk fields terminated by ' ';"mysql -u User -pPassword -DDatabase -e "${inscript}"rm -f /root/aa################################chmod 755 mytest


0 0
原创粉丝点击