Hughendman / Hughendman.github.io

2 stars 2 forks source link

python-nginx日志埋点导入mysql | YINXS的博客 #61

Open Hughendman opened 6 years ago

Hughendman commented 6 years ago

https://hughendman.github.io/post/dccb0cee.html

Hughendman commented 6 years ago

这个是建库的sql

SET FOREIGN_KEY_CHECKS=0;


-- Table structure for tj_md


DROP TABLE IF EXISTS tj_md; CREATE TABLE tj_md ( id int(11) NOT NULL AUTO_INCREMENT, msec varchar(255) DEFAULT NULL, remote_addr varchar(255) DEFAULT NULL, u_domain varchar(255) DEFAULT NULL, u_url varchar(255) DEFAULT NULL, u_title varchar(255) DEFAULT NULL, u_referrer varchar(255) DEFAULT NULL, u_sh varchar(255) DEFAULT NULL, u_sw varchar(255) DEFAULT NULL, u_cd varchar(255) DEFAULT NULL, u_lang varchar(255) DEFAULT NULL, http_user_agent varchar(255) DEFAULT NULL, u_utrace varchar(255) DEFAULT NULL, u_account varchar(255) DEFAULT NULL, time_local varchar(255) DEFAULT NULL, u_uid varchar(255) DEFAULT NULL, u_pid varchar(255) DEFAULT NULL, u_option varchar(255) NOT NULL, date timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- Records of tj_md


Hughendman commented 6 years ago

重启: /etc/init.d/crond restart 查看日志: cat /var/log/cron 修改: crontab -e

Hughendman commented 6 years ago

如果发现shell脚本重复执行n次,执行: ps -A | grep cron ,看看是不是启动了多个进程,把其他的kill掉