The arguments to zmdailyreport include:
--user <email_address> Report usage for <email_address> only
--mail Send report via email, default is stdout
--now Shortcut for midnight to the current time
--time <start>,<end> Default is midnight to midnight of the previous day
Start and end times must be in YYYYMMDD[hhmmss] format
So you can either-
A) Run it manually:
Quote:
cd /opt/zimbra/libexec
./zmdailyreport -m -t start,end
|
Comma included or it wont find the end time.
./zmdailyreport -m -t 20090301112233,2009031211223
You also don't have to be that specific:
./zmdailyreport -m -t 2009,20090312
B) Modify cron:
su - zimbra
contab -e (opens in vim)
Quote:
# Daily reports
#
10 1 * * * /opt/zimbra/libexec/zmdailyreport -m
|
You'll want to put in values for -t such that it's auto (make yourself a $datefirstmonth & $datecurrent)
C) Modify /opt/zimbra/libexec/zmdailyreport default to contain *720 or an extra *30 (or so):
Quote:
# usage: getTimes( now => $Opt{now}, time => $Opt{time} )
sub getTimes {
my %arg = @_;
my ( $start, $end );
if ( $arg{time} ) {
( $start, $end ) = split( /\s*,\s*/, $arg{time} );
$start = timeToSqlTime($start);
$end = timeToSqlTime($end) if ($end);
}
elsif ( $arg{now} ) {
$start = tsToSqlTime( time(), 1 );
$end = tsToSqlTime( time(), 0 );
}
else { # default to the previous day
$start = tsToSqlTime( ( time() - ( 60 * 60 * 24 ) ), 1 );
$end = tsToSqlTime( time(), 1 );
}
return ( $start, $end );
|
Keep in mind it checks the logger DB, so the results you get are going to be limited by:
zimbraLogRawLifetime (default 31d) - lifetime (nnnnn[hmsd]) of raw log rows in consolidated logger tables
zimbraLogSummaryLifetime (default 730d)- lifetime (nnnnn[hmsd]) of summarized log rows in consolidated logger tables
Adjust with: zmprov mcf zimbraLogAttribute Xd