I want to make sure I understand the situation:
You have the following command inside of a BASH script:
Code:
aureport -i --failed -ts 12\/08\/2009 > somefile.txt
Correct?
Yes
And, then the cronjob running the script keeps giving you different output. Right?
I removed the problem command from the main script as to simplify troubleshooting.
[root@someae485151l ~]# ls -l file
-rwxr-xr-x 1 root root 53 Dec 17 18:19 file
[root@someae485151l ~]# cat file
#! bash
/sbin/aureport -i --failed -ts 12\/16\/2009
[root@someae485151l ~]#
The cron is setup for troubleshooting:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /root/file
The root user receives an e-mail saying:
error parsing start date (12/08/2009)
If I don't escape out the forward slashes I get:
usage: aureport [options]
-a,--avc Avc report
--auth Authentication report
-c,--config Config change report
-cr,--crypto Crypto report
-e,--event Event report
-f,--file File name report
--failed only failed events in report
-h,--host Remote Host name report
--help help
-i,--interpret Interpretive mode
-if,--input <Input File name> use this file as input
--input-logs Use the logs even if stdin is a pipe
-l,--login Login report
-k,--key Key report
-m,--mods Modification to accounts report
-ma,--mac Mandatory Access Control (MAC) report
--node <node name> Only events from a specific node
-n,--anomaly aNomaly report
-p,--pid Pid report
-r,--response Response to anomaly report
-s,--syscall Syscall report
--success only success events in report
--summary sorted totals for main object in report
-t,--log Log time range report
-te,--end [end date] [end time] ending date & time for reports
-tm,--terminal TerMinal name report
-ts,--start [start date] [start time] starting data & time for reports
-u,--user User name report
-v,--version Version
-x,--executable eXecutable name report
If no report is given, the summary report will be displayed
Again it works fine when I run file from the command line it is just through cron.