zabbix清理旧数据-创新互联
zabbix 清理旧数据
目前创新互联已为近千家的企业提供了网站建设、域名、网页空间、网站运营、企业网站设计、固阳网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。#!/bin/bash User=user Passwd=passwd Date=`date -d $(date -d "-30 day" +%Y%m%d) +%s` #取30天之前的时间戳 $(which mysql) -u${User} -p${Passwd} -S /tmp/mysql.sock -e " use zabbix; DELETE FROM history WHERE 'clock' < $Date; optimize table history; DELETE FROM history_str WHERE 'clock' < $Date; optimize table history_str; DELETE FROM history_uint WHERE 'clock' < $Date; optimize table history_uint; DELETE FROM history_text WHERE 'clock' < $Date; optimize table history_text; DELETE FROM trends WHERE 'clock' < $Date; optimize table trends; DELETE FROM trends_uint WHERE 'clock' < $Date; optimize table trends_uint; DELETE FROM events WHERE 'clock' < $Date; optimize table events; "mysql ibdata空间清理
mysqldump -u [username] -p[root_password] [database_name] > dumpfilename.sql DROP DATABASE database_name /etc/init.d/mysqld stop rm /var/lib/mysql/ibdata1 rm /var/lib/mysql/ib_logfile* /etc/init.d/mysqld start create database [database_name] mysql -u [username]-p[root_password] [database_name] < dumpfilename.sql另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
分享标题:zabbix清理旧数据-创新互联
URL链接:http://lswzjz.com/article/ddcpje.html