|
View previous topic :: View next topic |
Author |
Message |
sabine
Joined: 07 Mar 2007 Posts: 25 Location: Austria
|
Posted: Tue May 08, 2007 4:12 am Post subject: shell script problem |
|
|
Hi,
I wrote a short and simple shell script in Hostmonitor:
Code: |
#!/bin/sh
cp -p /mnt/tmp/cronbackup/root /var/spool/cron/root
RES=$?
crontab /var/spool/cron/root
RES2=$?
if [ $RES -eq 0 -a $RES2 -eq 0 ]
then
echo "ScriptRes:Ok: copyEC: "RES", crontabEC: "RES2
else
echo "ScriptRes:Bad: copyEC: "RES", crontabEC: "RES2
fi
|
I use this for copying my backup crontab file to my usual crontab directory.
When executed by RMA 1.24 at RHEL4 on first Computer, it works.
When executed by RMA 1.24 at RHEL4 on second Computer it doesn't work. I get copy Errorcode 1 as Result and crontab Errorcode 0.
When executed by hand directly on RHEL4 everything works fine. Both computers are similar configured (same HW, same SW).
Any ideas what went wrong?
Regards,
sabine |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Tue May 08, 2007 5:41 am Post subject: |
|
|
Hm. It is hard to say what is wrong. I think, there is some configuration issues. Could you verify all settings for the second test? Probably, you have selected wrong agent for "Shell Script" test method? Does rma started under root account on the second system? For the debug purposes, could you replace string "cp -p /mnt/tmp/cronbackup/root /var/spool/cron/root" with the following one:
Code: | cp -p /mnt/tmp/cronbackup/root /var/spool/cron/root 2> /usr/local/s_debug.txt |
What exact error do you see in /usr/local/s_debug.txt file?
Regards,
Max |
|
Back to top |
|
|
sabine
Joined: 07 Mar 2007 Posts: 25 Location: Austria
|
Posted: Wed May 09, 2007 1:10 am Post subject: |
|
|
Thanks,
got the foult, silly me used wrong agent.
Regards
sabine |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|