Probably should provide a usage for others in the future.... Here is an example of one method:
Code: Select all
su - zimbra
ls
2019-05-15 2019-05-21 2019-05-27 2019-06-02 2019-06-08 2019-06-14 2019-06-20 2019-06-26 2019-07-02 df.csv ldap.csv pid sync.csv zmstat.out-20190630.gz
2019-05-16 2019-05-22 2019-05-28 2019-06-03 2019-06-09 2019-06-15 2019-06-21 2019-06-27 2019-07-03 df.csv.gz mailboxd.csv pop3.csv threads.csv zmstat.out-20190701.gz
2019-05-17 2019-05-23 2019-05-29 2019-06-04 2019-06-10 2019-06-16 2019-06-22 2019-06-28 allprocs.csv fd.csv mtaqueue.csv proc.csv vm.csv zmstat.out-20190702.gz
2019-05-18 2019-05-24 2019-05-30 2019-06-05 2019-06-11 2019-06-17 2019-06-23 2019-06-29 allprocs.csv.gz imap.csv mysql.csv slapd.csv zmstat.out zmstat.out-20190703.gz
2019-05-19 2019-05-25 2019-05-31 2019-06-06 2019-06-12 2019-06-18 2019-06-24 2019-06-30 convertd.csv io-x.csv mysql.csv.gz soap.csv zmstat.out-20190628.gz zmstat.out-20190704.gz
2019-05-20 2019-05-26 2019-06-01 2019-06-07 2019-06-13 2019-06-19 2019-06-25 2019-07-01 cpu.csv io.csv nginx.csv sql.csv zmstat.out-20190629.gz
[zimbra@tmail zmstat]$ /opt/zimbra/libexec/zmstat-cleanup --keep 5
Deleting 2019-06-28 zmstat archive.
Deleting 2019-06-27 zmstat archive.
Deleting 2019-06-26 zmstat archive.
Deleting 2019-06-25 zmstat archive.
Deleting 2019-06-24 zmstat archive.
Deleting 2019-06-23 zmstat archive.
Deleting 2019-06-22 zmstat archive.
Deleting 2019-06-21 zmstat archive.
Deleting 2019-06-20 zmstat archive.
Deleting 2019-06-19 zmstat archive.
Deleting 2019-06-18 zmstat archive.
Deleting 2019-06-17 zmstat archive.
Deleting 2019-06-16 zmstat archive.
Deleting 2019-06-15 zmstat archive.
Deleting 2019-06-14 zmstat archive.
Deleting 2019-06-13 zmstat archive.
Deleting 2019-06-12 zmstat archive.
Deleting 2019-06-11 zmstat archive.
Deleting 2019-06-10 zmstat archive.
Deleting 2019-06-09 zmstat archive.
Deleting 2019-06-08 zmstat archive.
Deleting 2019-06-07 zmstat archive.
Deleting 2019-06-06 zmstat archive.
Deleting 2019-06-05 zmstat archive.
Deleting 2019-06-04 zmstat archive.
Deleting 2019-06-03 zmstat archive.
Deleting 2019-06-02 zmstat archive.
Deleting 2019-06-01 zmstat archive.
Deleting 2019-05-31 zmstat archive.
Deleting 2019-05-30 zmstat archive.
Deleting 2019-05-29 zmstat archive.
Deleting 2019-05-28 zmstat archive.
Deleting 2019-05-27 zmstat archive.
Deleting 2019-05-26 zmstat archive.
Deleting 2019-05-25 zmstat archive.
Deleting 2019-05-24 zmstat archive.
Deleting 2019-05-23 zmstat archive.
Deleting 2019-05-22 zmstat archive.
Deleting 2019-05-21 zmstat archive.
Deleting 2019-05-20 zmstat archive.
Deleting 2019-05-19 zmstat archive.
Deleting 2019-05-18 zmstat archive.
Deleting 2019-05-17 zmstat archive.
Deleting 2019-05-16 zmstat archive.
Deleting 2019-05-15 zmstat archive.
[zimbra@tmail zmstat]$ ls
2019-06-29 2019-07-02 allprocs.csv.gz df.csv imap.csv ldap.csv mysql.csv pid slapd.csv sync.csv zmstat.out zmstat.out-20190630.gz zmstat.out-20190703.gz
2019-06-30 2019-07-03 convertd.csv df.csv.gz io-x.csv mailboxd.csv mysql.csv.gz pop3.csv soap.csv threads.csv zmstat.out-20190628.gz zmstat.out-20190701.gz zmstat.out-20190704.gz
2019-07-01 allprocs.csv cpu.csv fd.csv io.csv mtaqueue.csv nginx.csv proc.csv sql.csv vm.csv zmstat.out-20190629.gz zmstat.out-20190702.gz
Add this to your zimbra's crontab if you wanted to retain a month or year, etc.