From 72c7f14484f470dbafa9c184c3db47da97ab15cd Mon Sep 17 00:00:00 2001 From: monlor Date: Tue, 11 Jun 2024 16:41:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E5=B0=8F=E9=9B=85alist?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E6=9B=B4=E6=96=B0=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 、 ✅ Closes: #87 --- alist/README.md | 2 +- alist/start.sh | 7 +++++-- env | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/alist/README.md b/alist/README.md index 66c7600..fce5173 100644 --- a/alist/README.md +++ b/alist/README.md @@ -48,4 +48,4 @@ docker run -d -p 5678:80 -p 2345:2345 -p 2346:2346 --restart=unless-stopped --na `AUTO_CLEAR_ENABLED`: 自动清理阿里云云盘的文件,true/false,默认false -`AUTO_CLEAR_INTERVAL`: 自动清理间隔,单位分钟,默认1分钟 \ No newline at end of file +`AUTO_CLEAR_INTERVAL`: 自动清理间隔,单位分钟,默认10分钟 \ No newline at end of file diff --git a/alist/start.sh b/alist/start.sh index e582ff1..9723336 100644 --- a/alist/start.sh +++ b/alist/start.sh @@ -140,12 +140,15 @@ crontabs="" if [ "${AUTO_UPDATE_ENABLED:=false}" = "true" ]; then echo "启动定时更新定时任务..." - crontabs="0 3 * * * /data.sh update" + # 随机生成一个时间,避免给服务器造成压力 + random_min=$(shuf -i 0-59 -n 1) + random_hour=$(shuf -i 2-6 -n 1) + crontabs="${random_min} ${random_hour} * * * /data.sh update" fi if [ "${AUTO_CLEAR_ENABLED:=false}" = "true" ]; then echo "启动定时清理定时任务..." - crontabs="${crontabs}\n*/${AUTO_CLEAR_INTERVAL:=1} * * * * /clear.sh" + crontabs="${crontabs}\n*/${AUTO_CLEAR_INTERVAL:=10} * * * * /clear.sh" fi if [ -n "${crontabs}" ]; then diff --git a/env b/env index 6732dc0..31bae1a 100644 --- a/env +++ b/env @@ -9,7 +9,7 @@ ALIYUN_FOLDER_ID= AUTO_UPDATE_ENABLED=true # 自动清理阿里云盘 AUTO_CLEAR_ENABLED=true -# 阿里云盘自动清理间隔,单位分钟,默认1分钟 +# 阿里云盘自动清理间隔,单位分钟,默认10分钟 AUTO_CLEAR_INTERVAL= # pikpak 账号,用来观看小雅中pikpak分享给你的资源,格式:`qqq@qq.com:aaadds` PIKPAK_USER=