问题原文
原帖链接 · ryank · CC BY-SA 3.0
I'm using crontab with a @reboot entry which starts a script containing a endless while-loop that is processing the output of a tail -F command. Is there any way to stop the currently running script and restart the @reboot rule without a actual reboot? I'm running Debian 6.
已采纳解答
原帖链接 · Journeyman Geek · CC BY-SA 3.0
I'm assuming you know the name of the script (use pkill), or can find out its processid (ps aux, then kill -9). Then start it again using the same command as in crontab. If you want to detach the process from the session, you can use nhup, or dtach or something similar.
Its pretty trivial. A better way to do this would be to write a init (or upstart or systemd) script, so you can just stop and start the service from there. This will depend on your distro, however.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
