[ubuntu-uk] Shutdown mysql with cron

Simon Greenwood sfgreenwood at gmail.com
Wed Aug 11 07:01:35 BST 2010

On 11 August 2010 00:13, Paul Willis <paul.willis at me.com> wrote:

> Hi
> I'm trying to shutdown MySQL on an Ubuntu 10.04 server for half hour
> everyday using cron but I can't get it to work
> Using "sudo crontab -e" I entered the line...
> 15 19 * * * root /etc/init.d/mysql stop
> In the syslog I can see it fired at the time I expected...
> Aug 10 19:15:01 domU-11-11-11-11-CD-11 CRON[5984]: (root) CMD (root
> /etc/init.d/mysql stop)
> But MySQL is still running.
> If I run the same /etc/init.d/mysql stop as root in the command line MySQL
> stops just fine.
> Any ideas why MySQL doesn't quit or where I might look for clues?
> 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
Not sure of the detail but it will be something that's present in the shell
that's not present in the session invoked from cron. As Sean says, logging
the event will give you a clue as to why it's failing. I would suggest that
you will need to wrap an environment around the command.


My CV: http://bit.ly/sfgreenwood_cv
Linkedin: http://www.linkedin.com/in/simonfgreenwood
Twitter: @sfgreenwood
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20100811/50666f01/attachment.htm 

More information about the ubuntu-uk mailing list