Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改定时清理阿里云盘频率 #189

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions alist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ 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`: 自动清理间隔,单位分钟,范围0-60分钟,默认10分钟
`AUTO_CLEAR_INTERVAL`: 自动清理阿里云盘时间节点,整点进行清理,范围0-23点(必须设置为整数),默认5点

`AUTO_CLEAR_THRESHOLD`: 阿里云盘自动清理文件存在时间阈值,单位分钟,范围0-60分钟,默认10分钟
`AUTO_CLEAR_THRESHOLD`: 阿里云盘自动清理文件存在时间阈值,单位分钟,范围0-60分钟,默认10分钟
16 changes: 1 addition & 15 deletions alist/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,7 @@ fi

if [ "${AUTO_CLEAR_ENABLED:=false}" = "true" ]; then
echo "启动定时清理定时任务..."
AUTO_CLEAR_INTERVAL=${AUTO_CLEAR_INTERVAL:=10}
HOURS=$(($AUTO_CLEAR_INTERVAL / 60))
REMAINING_MINUTES=$(($AUTO_CLEAR_INTERVAL % 60))

if [ $HOURS -gt 0 ]; then
if [ $REMAINING_MINUTES -eq 0 ]; then
CRONTAB_TIME="0 */$HOURS * * *"
else
CRONTAB_TIME="$REMAINING_MINUTES */$HOURS * * *"
fi
else
CRONTAB_TIME="*/$REMAINING_MINUTES * * * *"
fi
crontabs="${crontabs}\n$CRONTAB_TIME /clear.sh"
#crontabs="${crontabs}\n*/${AUTO_CLEAR_INTERVAL:=10} * * * * /clear.sh"
crontabs="${crontabs}\n* ${AUTO_CLEAR_INTERVAL:=5} * * * /clear.sh"
fi

# 添加后台守护
Expand Down
4 changes: 2 additions & 2 deletions env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PAN115_COOKIE=
AUTO_UPDATE_ENABLED=true
# 自动清理阿里云盘
AUTO_CLEAR_ENABLED=true
# 阿里云盘自动清理间隔,单位分钟,范围0-60分钟,默认10分钟
# 自动清理阿里云盘时间节点,整点进行清理,范围0-23点(必须设置为整数),默认5点
AUTO_CLEAR_INTERVAL=
# pikpak 账号,用来观看小雅中pikpak分享给你的资源,格式:`[email protected]:aaadds`
PIKPAK_USER=
Expand All @@ -40,4 +40,4 @@ AUTO_UPDATE_EMBY_INTERVAL=
# 自动更新emby元数据
AUTO_UPDATE_EMBY_METADATA_ENABLED=true
# emby的apikey
EMBY_APIKEY=
EMBY_APIKEY=