统计系统七----主要执行的shell文件

xiaoxiao2026-05-16  16

这里是执行整个系统的主文件 stat_main.sh 下载,解析入库,最后执行存储过程 附件为整个代码,包括配置文件,目录等 . comm_function.shwork_path=`getWorkPath`#获取配置文件的路径config_address=$work_path"/config";comm_config_file=$config_address"/comm.config"lasthour=`date --date="1 hour ago" +%Y-%m-%d-%H`#下载日志的时间,即需要下载解析哪一个时间的日志if test $1then lasthour=$1;fistat_date=$(echo ${lasthour}|cut -c 1-10);stat_hour=$(echo ${lasthour}|cut -c 12-13);#第一个参数为类型,是pv还是click#第二个参数为临时文件的名称,即awk解析后存放的文件名称,只是最后生成时会带上"_pv"#第三个参数为时间#pv日志下载并入库./stat_hour.sh pv /usr/local/qs/p/temp/format ${lasthour}#click日志下载./stat_hour.sh click /usr/local/qs/p/temp/format ${lasthour}#获取mysql的信息mysql_head=`getConfigValue "mysql_head" ${comm_config_file}`#获取执行住存储过程的名称procedure=`getConfigValue "sql_procedure" ${comm_config_file}`#执行存储过程${mysql_head} "call ${procedure}('${stat_date}','${stat_hour}')"
转载请注明原文地址: https://www.6miu.com/read-5048873.html

最新回复(0)