Unable to run a service command via cron

ServiceCron

Service Problem Overview


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 Solutions


Solution 1 - Service

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAshView Question on Stackoverflow
Solution 1 - ServiceDark FalconView Answer on Stackoverflow