Skip to content

Instantly share code, notes, and snippets.

@sric0880
Created December 10, 2022 13:08
Show Gist options
  • Select an option

  • Save sric0880/cc04f44317d8911f9463fa34fdab44c3 to your computer and use it in GitHub Desktop.

Select an option

Save sric0880/cc04f44317d8911f9463fa34fdab44c3 to your computer and use it in GitHub Desktop.
#!/bin/bash
mysql -uzabbix -pzabbix -e"
use zabbix;
truncate table history;
optimize table history;
truncate table history_log;
optimize table history_log;
truncate table history_str;
optimize table history_str;
truncate table history_uint;
optimize table history_uint;
truncate table alerts;
optimize table alerts;
truncate table trends;
optimize table trends;
truncate table trends_uint;
optimize table trends_uint;
delete from events;
optimize table events;
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment