#! /bin/bash . /opt/app/bi-app/energy/history/config.sh url=$MYSQL_URL username=$MYSQL_USER password=$MYSQL_PASSWORD database=saga_dev del_energy_15_min_history="truncate table energy_15_min_history;" del_energy_5_min_history="truncate table energy_5_min_history;" ## 历史数据一次性导入后,需要删除 mysql 中的冗余数据 clean_energy_15(){ mysql -h${url} -P3306 -u${username} -p${password} ${database} -e "${del_energy_15_min_history}" } clean_energy_5(){ mysql -h${url} -P3306 -u${username} -p${password} ${database} -e "${del_energy_5_min_history}" }