[ubuntu-uk] Shutdown mysql with cron

Paul Willis paul.willis at me.com
Wed Aug 11 00:13:52 BST 2010


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

Cheers

Paul



More information about the ubuntu-uk mailing list