Deepak Singhal
Deepak Singhal

Reputation: 10874

On AWS; Ubuntu; Not able to restart mysql using crontab

On AWS with Ubuntu; Not able to restart mysql using crontab : I tried following commands in the script:

service mysql  start
 /etc/init.d/mysql restart

Errors I get are:

exec: 129: start: not found
/etc/init.d/mysql: 85: start: not found
exec: 129: restart: not found

All these works fine if I run from prompt; but fails from crontab

Upvotes: 1

Views: 1417

Answers (1)

Deepak Singhal
Deepak Singhal

Reputation: 10874

Path was the problem. On command prompt I got $PATH; and then in crontab script ; I manually added this path like this. It works now.

PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Upvotes: 1

Related Questions