On 11 August 2010 00:13, Paul Willis <paul.wil...@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.

Simon

-- 
My CV: http://bit.ly/sfgreenwood_cv
Linkedin: http://www.linkedin.com/in/simonfgreenwood
Twitter: @sfgreenwood
-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/

Reply via email to