Skip to content

Commit

Permalink
Update cron-restart-a2b.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperNG6 committed Aug 27, 2023
1 parent b451973 commit 03a2734
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions root/aria2/script/cron-restart-a2b.sh
Expand Up @@ -18,7 +18,7 @@ else
(crontab -l | grep -v "ps -ef | grep aria2b | grep -v grep | awk '{print \$2}' | xargs kill -9") | crontab -
echo "已移除现有的定时重启 aria2b 任务。"

# 设置新的 cron job,在每小时的整点执行杀死 aria2b 进程的命令
# 设置新的 cron job,在每小时的整点执行重启 aria2b 进程的命令
(crontab -l ; echo "0 */$HOURS * * * ps -ef | grep aria2b | grep -v grep | awk '{print \$2}' | xargs kill -9") | crontab -
echo "已设置定时任务,在每 $HOURS 小时的整点执行重启 aria2b 进程的命令。"
else
Expand All @@ -28,7 +28,7 @@ else
(crontab -l | grep -v "ps -ef | grep aria2b | grep -v grep | awk '{print \$2}' | xargs kill -9") | crontab -
echo "CRA2B 的值无效。已将 CRA2B 设置为默认值 2 小时。"

# 设置新的 cron job,在每小时的整点执行杀死 aria2b 进程的命令
# 设置新的 cron job,在整点执行重启 aria2b 进程的命令
(crontab -l ; echo "0 */$HOURS * * * ps -ef | grep aria2b | grep -v grep | awk '{print \$2}' | xargs kill -9") | crontab -
echo "已设置定时任务,在每 $HOURS 小时的整点执行重启 aria2b 进程的命令。"
fi
Expand Down

0 comments on commit 03a2734

Please sign in to comment.