Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要每 3 秒调用一次命令的守护程序脚本: cat /proc/stat > /some/file
谁能帮我制作和设置这个?(系统是debian挤压)
像这样?
#!/bin/sh while true do cat /proc/stat > /some/file sleep 3 done
并运行它/path/to/scrip.sh &
/path/to/scrip.sh &
(使用拖尾&在后台运行,即:“守护进程”模式)
&
它不是很复杂(例如,一旦它开始就停止它的唯一方法就是杀死它),但是会按照您的要求进行。