Loading... ```nano qb.sh nano qb.sh ``` ```#!/bin/bash #@author smallForest #@email 1032817724@qq.com proc_name="qbittorrent-nox" #进程名字 proc_num() { num=`ps -ef | grep $proc_name | grep -v grep | wc -l` return $num } proc_num number=$? echo $number if [ $number -eq 0 ] then #cd /Applications/MAMP/htdocs/aa/bb/public #进入路径 systemctl start qbittorrent.service # 创建守护进程 fi ``` ```chmod u+x qb.sh chmod u+x qb.sh ``` ```nano /etc/crontab nano /etc/crontab ``` ```*/1 * * * * root /root/qb.sh */1 * * * * root /root/qb.sh ``` 最后修改:2022 年 05 月 27 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 0 如果觉得我的文章对你有用,请随意赞赏