Reputation: 491
service bots stop service bots start
*/5 * * * * /home/vps171-107/runcron.sh
How can I make runcron.sh stop then start the bots service in crontab ?
UPDATE
After the help from @armnotstrong , I've change the script to
/usr/sbin/service bots stop
/usr/sbin/service bots start
And it works!
Upvotes: 6
Views: 7195
Reputation: 9065
It may be an env issue, crontab may execute the command with sh
not bash
try:
*/5 * * * * bash /home/vps171-107/runcron.sh
Upvotes: 4