<br><br><div class="gmail_quote">On 11 August 2010 00:13, Paul Willis <span dir="ltr">&lt;<a href="mailto:paul.willis@me.com">paul.willis@me.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi<br>
<br>
I&#39;m trying to shutdown MySQL on an Ubuntu 10.04 server for half hour everyday using cron but I can&#39;t get it to work<br>
<br>
Using &quot;sudo crontab -e&quot; I entered the line...<br>
<br>
15 19 * * * root /etc/init.d/mysql stop<br>
<br>
In the syslog I can see it fired at the time I expected...<br>
<br>
Aug 10 19:15:01 domU-11-11-11-11-CD-11 CRON[5984]: (root) CMD (root /etc/init.d/mysql stop)<br>
<br>
But MySQL is still running.<br>
<br>
If I run the same /etc/init.d/mysql stop as root in the command line MySQL stops just fine.<br>
<br>
Any ideas why MySQL doesn&#39;t quit or where I might look for clues?<br>
<br>
Just for extra info: this server is a MySQL replication slave running on Ubuntu on Amazon EC2 and I want to shutdown MySQL, snapshot the volume, restart MySQL<br>
<br></blockquote><div><br></div><div>Not sure of the detail but it will be something that&#39;s present in the shell that&#39;s not present in the session invoked from cron. As Sean says, logging the event will give you a clue as to why it&#39;s failing. I would suggest that you will need to wrap an environment around the command.</div>
<div><br></div><div>Simon </div></div><br>-- <br>My CV: <a href="http://bit.ly/sfgreenwood_cv">http://bit.ly/sfgreenwood_cv</a><br>Linkedin: <a href="http://www.linkedin.com/in/simonfgreenwood">http://www.linkedin.com/in/simonfgreenwood</a><br>
Twitter: @sfgreenwood<br>