Script runs Manually but not in Cron, yet other parts of the script run
I have script that runs if I execute it as root manually but when I direct it to run in a script the file size is always 0. See below:
#!/bin/bash /sbin/ausearch -i -ts week-ago -k open --success no >/audits/open.txt lastb -n 35 >/audits/failedlogin.txt The line lastb -n 35 >/audits/failedlogin.txt results in a output file and it works but the line /sbin/ausearch -i -ts week-ago -k open --success no >/audits/open.txt only results in a new file with nothing in it however if I run it manualy the file is populated? Is this an enviornmental issue when cron is run? A million thanks in advance, Johnny Mac |
Try putting in the full path for lastb rather than relying on a path to be set. example: /usr/bin/lastb
|
Lastb works
The lastb portion of the script works but not the below:
/sbin/ausearch -i -ts week-ago -k open --success no >/audits/open.txt |
man ausearch
Code:
--input-logs |
Will let you know
Cedrik,
I will try this next week and post what happens. Thanks for the advice. Johnny Mac |
Sorry that did not work
Runing a serach and directing the path did not work (same results). I also osed the if option and results were the same.
Oh well. |
All times are GMT -5. The time now is 03:25 AM. |