<span class="Apple-style-span" style="font-family: 'Times New Roman'; background-color: rgb(255, 255, 255); font-size: medium; "><div>May I suggest a permission problem?</div><div><br></div><div>In order to cron to execute something automatically, the script need +x I think.</div>
<div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
Looks like a environment-(path)-problem. Can you set the same paths in<br>the script as you have as user "root"?<br>
Do this with "export PATH=$PATH:/usr/sbin....."<br>
Regards,<br>Tom<br>
2011/10/28 ihjaz Mohamed <<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">ihjazmohamed at yahoo.co.in</a>>:<br>><i> Hi All,<br>
</i>><i> Am facing a strange issue. When I schedule a script to be run via cron, the<br>
</i>><i> 'crm status' command in the script doesn't get executed. Every other<br>
</i>><i> commands are executed properly.<br>
</i>><i> Here's a test script I wrote to test this issue.<br>
</i>><br>><i> [<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">root at BLRACE70</a> ~]# cat test.sh<br>
</i>><i> #!/bin/sh<br>
</i>><br>><i> /usr/sbin/crm status >> /var/log/cron_log.log<br>
</i>><i> echo "Returned:$?" >> /var/log/cron_log.log<br>
</i>><br>><i> If I run the above file manually. I get output as below in the log:<br>
</i>><i> ============<br>
</i>><i> Last updated: Fri Oct 28 17:14:07 2011<br>
</i>><i> Stack: openais<br>
</i>><i> Current DC: <a href="http://aceblr073.com">aceblr073.com</a> - partition with quorum<br>
</i>><i> Version: 1.1.5-5.el6-01e86afaaa6d4a8c4836f68df80ababd6ca3902f<br>
</i>><i> 2 Nodes configured, 1 expected votes<br>
</i>><i> 2 Resources configured.<br>
</i>><i> ============<br>
</i>><br>><i> Online: [ <a href="http://aceblr073.com">aceblr073.com</a> BLRACE70 ]<br>
</i>><br>><i> Resource Group: HAService<br>
</i>><i> FloatingIP (ocf::heartbeat:IPaddr2): Started <a href="http://aceblr073.com">aceblr073.com</a><br>
</i>><i> acestatus (lsb:acestatus): Started <a href="http://aceblr073.com">aceblr073.com</a><br>
</i>><i> Clone Set: pingdclone [pingd]<br>
</i>><i> Started: [ <a href="http://aceblr073.com">aceblr073.com</a> BLRACE70 ]<br>
</i>><i> Returned:0<br>
</i>><br>><i> If I schedule it through cron as below:<br>
</i>><br>><i> [<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">root at BLRACE70</a> ~]# crontab -l<br>
</i>><i> */1 * * * * /root/test.sh > /dev/null 2>&1<br>
</i>><br>><i> I get the following output in the log.<br>
</i>><i> Returned:1<br>
</i>><i> Returned:1<br>
</i>><i> Returned:1<br>
</i>><i> Returned:1<br>
</i>><i> Returned:1<br>
</i>><i> Returned:1<br>
</i>><i> Returned:1<br>
</i>><br>><i> Has anyone run into this issue before?<br>
</i>><br>><br>><br>><br>><br>><br>><i> _______________________________________________<br>
</i>><i> Pacemaker mailing list: <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">Pacemaker at oss.clusterlabs.org<br></a>
</i>><i> <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br></a>
</i>><br>><i> Project Home: <a href="http://www.clusterlabs.org/">http://www.clusterlabs.org<br></a>
</i>><i> Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br></a>
</i>><i> Bugs:<br>
</i>><i> <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker<br></a>
</i>><br>></blockquote></span><div><br></div>-- <br>/* Arturo Borrero Gonzalez || <a href="mailto:cer.inet@linuxmail.org" target="_blank">cer.inet@linuxmail.org</a> */<br>/* Use debian gnu/linux! Best OS ever! */<br>
<br>