高级计划进程/任务管理器-Linux [英] Advanced Scheduled Process/Task Manager - Linux
问题描述
需要一些建议,我正在寻找适用于Ubuntu的不错的进程/任务管理器。
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.
例如,我想每天在9:00-17:00之间运行程序X。如果该进程仍在运行,则应在17:00将其杀死。如果该过程在上午9点至下午5点之间崩溃,则应自动重新启动该过程。
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.
有没有易于使用的工具可以做到这一点?我想避免管理PID文件和执行开始和停止操作的cron作业...
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!
干杯。
推荐答案
我不知道如果存在用于此目的的工具,但是除非您有许多交互式任务,否则它对于管理一些工作确实不是一个大问题:
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)您可以
2)您可以在有条件的情况下在这些脚本中插入自杀。
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.
这篇关于高级计划进程/任务管理器-Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!