Unable to run a service command via cron

2019-01-23 10:33发布

service service_name start

When i tried running this from cmd line, it works. But when i try to schedule it via cron, i get an error saying

/bin/sh: service: command not found

标签: service cron
1条回答
啃猪蹄的小仙女
2楼-- · 2019-01-23 11:22

sbin is not in the path when run via cron. Specify the full path to service. This is probably either /sbin/service or /usr/sbin/service. You can find the path on your system by running which service.

查看更多
登录 后发表回答