total newbie here, Ive read through some of the threads about cron and scripts not working and have still drawn a blank as to why mine isnt working correctly.
I have a script that runs the ausearch with a set of criteria i have setup, the only access i have to the system is via puttycm(putty) and su to the root account.
The script checks the audit log for the criteria and dumps it out to a file i have specified, now when I call this from bash it runs fine and creates all the files and populates all the files I expect it to from the files I am watching in auditd.
when I setup cron to do this all the files get created but nothing get populated into them.
Sample script:
from crontab -e:
17 19 * * * /var/audits/script/audits.sh
As you can see I am using absolute paths so i dont think its that, this really has me stumped.
If this is Red Hat 5.1 it is a known problem which is fixed in 5.2 (introduced the --input-logs parameter).
Of course if you have the later version you need to specify the --input-logs parameter to stop the program reading from standard input).
I should have mentioned this is running on CentOS 5.2
---------- Post updated at 03:37 PM ---------- Previous update was at 12:24 PM ----------
Are there any other scheduling apps I can try out for CentOS 5.2? as cron seems to be very picky about what it runs, and I cant see any reason why my script is having problems.
Ive even told the /sbin/ausearch the full path to the audit file incase it cant find it, using cron.
I should have mentioned this is running on CentOS 5.2
---------- Post updated at 03:37 PM ---------- Previous update was at 12:24 PM ----------
Are there any other scheduling apps I can try out for CentOS 5.2? as cron seems to be very picky about what it runs, and I cant see any reason why my script is having problems.
Ive even told the /sbin/ausearch the full path to the audit file incase it cant find it, using cron.
strace/truss the command and see if it's successfully opening your audit.log file.
You should find something like:
Also, try upgrading your audit and audit libs to the latest version to ensure that your ausearch is not under the effects of RH bug 436301.
From the ausearch manpage:
Last edited by verdepollo; 04-21-2010 at 12:32 PM..
Reason: Suggest RPM update.
Hi I want to set up a cron for every 15 minutes between some hours.
Can you tell whether the below command will work.
Getting confuse because my time goes from night to next day morning.
i want to setup 8 PM to next day 10 AM.
*/15 20-10 * * * sh abc.sh (1 Reply)
Good evening, ive got this cron to be run:
if i run this manually it doesnt work,it takes me to the prompt again
/export/app/CO/opge/scr/Informe_parametros_colombia.ksh >/dev/null 2>&1
here is the code fragment:
coopge@coopge: opge PRODUCCION>more... (1 Reply)
I am trying to setup a cron that runs a script to update my ip for my domain name every time I reboot and checks if my ip changes every 5 minutes and if it does then I update it. I am running Ubuntu server 12.04.
The file /etc/cron.d/ipupdate contains
#
#
# Run ipupdate
#
#
/5 * ... (3 Replies)
Hi all!!
I have a nerve-wracking concept (probably for me!!) which is not understood. My crontab entry looks this way.
33 09 22 3 * /home/myexp.sh "Bgp4 ALL" >/dev/null 2>&1
But cron gets started occasionally. Sometimes it does. Sometimes it does not. And sometimes it hangs in the middle (I... (1 Reply)
how to store a date into file?
and how we can access date from the file?
---------- Post updated at 06:09 AM ---------- Previous update was at 06:08 AM ----------
how we can store date in file? (1 Reply)
Hi all, I have a script running on a Solaris 8 box and the first thing it does it check which user is executing it;
if ; then
echo "This script must be run as testuser" 1>&2
exit 1
fi
This works fine when manually running the script however when adding into that users' crontab it... (1 Reply)
Dear Friends,
I am running a script which runs a select query from a sybase table and outputs the result (1 row) into a .txt file in unix. When I run the script manually it behaves normally. However it doesnt run in crontab.
#!/usr/bin/ksh
. /opt/ivb/config/set_env
... (1 Reply)
Hi there,
this time a have a other problem :)
i will start a script over the cron.
if i start the script manual (per command) it works without any problems, but over the cron it doesent work.
my cron looks like this:
26 15 * * * /path/scriptname.sh 2> /path/error.log
there is no... (3 Replies)
Hi, I am having a few problems with cron.
I have created a shell script (to rotate www logs - this works) and then did the following (as root)
#crontab -e
2 0 * * 3 /cron_scripts/wwwlogs.sh
?
w
?
q
#
crontab -l
entry not shown e.g. it did not show what I had just writern
I then... (6 Replies)
I'm having serious problems running cron. I want to create midnight backups of my files on my unix server and there is something wrong with cron.
Here is what I do:
First I saw that cron is running (while logged on as root) by typing "ps -aedf|grep cron" and I noticed that there is 1 instance... (4 Replies)