1

I set up two aureport cron jobs the other day:

1 0 * * * /sbin/aureport -ts yesterday 00:00:00 | mailx -r "info@domain.com" -s "[Audit report] Summary" "user@domain.com"
1 0 * * * /sbin/aureport --tty -ts yesterday 00:00:00 | mailx -r "info@domain.com" -s "[Audit report] TTY details" "user@domain.com"

However, the e-mails I receive when I run the commands via cron don't contain any useful information. Sample output from the first cron line:

Summary Report
======================
Range of time in logs: 12/31/1969 13:00:00.000 - 12/31/1969 13:00:00.000
Selected time for report: 05/11/2016 00:00:00 - 12/31/1969 13:00:00.000
Number of changes in configuration: 0
Number of changes to accounts, groups, or roles: 0
...
Number of process IDs: 0
Number of events: 0

I know that 12/31/1969 is equivalent to "I have no idea what time this is."

On the other hand, running each command from a terminal sends an e-mail containing valid date/time ranges as well as non-empty information.

K. Doe
  • 13
  • 3

1 Answers1

2

Add --input-logs to the commands. It forces the command to use the logs instead of STDIN.

1 0 * * * /sbin/aureport --input-logs -ts yesterday 00:00:00 | mailx -r "info@domain.com" -s "[Audit report] Summary" "user@domain.com"
1 0 * * * /sbin/aureport --input-logs --tty -ts yesterday 00:00:00 | mailx -r "info@domain.com" -s "[Audit report] TTY details" "user@domain.com"
willseward
  • 36
  • 3