Advanced Scheduled Process/Task Manager - Linux

2019-06-07 23:25发布

Need some advice, I'm after a decent process/task manager for Ubuntu.

Basically I have a few scripts/programs which I want to run as long running processes, but I want to shut them down at various periods (say over the weekend or every day for a few hours). During the time that the process needs to be up and crashes, I would like it so that the task scheduler will automatically restart the process.

SO for example, I want to run program X between 9:00-17:00 every day. If the process is still running it should be killed at 17:00. If the process crashes between 9AM and 5PM then the process should be automatically restarted.

Are there any easy to use tools which can do this? I would like to avoid having to manage PID files and having cron jobs which do the start and stop...

Any thing anyone recommends? Any advice appreciated!

Cheers.

1条回答
够拽才男人
2楼-- · 2019-06-07 23:33

I do not know if a tool exists for this, but except if you have many interactive tasks, it really does not a that big issue to manage for a few jobs :

1) You can start your cronjobs whenever you like thanks to the crontab,

2) You can insert a "commit suicide" within these scripts under a time condition for example.

# your script doing things
# Then it commit suicide
if [ your_condition ];then
  kill $$
fi

Please note that if you want to allow users login only at certain periods of time, then it's a different question.

查看更多
登录 后发表回答