I can use the following commands:

start node-server stop node-server restart node-server 

So I start in my node server, and it works

If I want to restart the node-server, then every minute for this I execute the restart node-server command

my crontab looks like this

 * * * * * restart node-server 

but the "restart node-server" command is not executed.

cron works, Linux works, node-server works, running from root via ssh.

Nothing else is broken, only cron

Is there any error logs in the krone?

Or maybe the shell from which I execute the restart command to the node server, it sees the restart command, and the shell does not

  • one
    cron is not broken. The understanding of the system is broken. The thing is that kroner is launched with its own set of environments. And the fact that your restart is in the PATH variable is good, but the krone is not. Register the full path to this command and everything will work (that is, something like / usr / bin / restart node-server). - KoVadim
  • To debug, try the /bin/date >>/tmp/date command to verify that cron is running - jfs
  • Oh, and is it possible to run crowns in the context of the environment of some user? And please answer with the answer) I will put it as the best) - Maxmaxmaximus

1 answer 1

The restart command was not visible to the crown just like that, you just need to set the paths of the environment right in the crontab at the top, and everything will work

 SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin * * * * * restart node-server