开发者

Advanced Scheduled Process/Task Manager - Linux

开发者 https://www.devze.com 2023-03-14 13:47 出处:网络
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 p

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 per开发者_如何学JAVAiods (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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消