This commit is contained in:
xyj 2023-12-07 16:25:01 +08:00
parent ed61de0b10
commit 23affef16d
2 changed files with 3 additions and 3 deletions

View File

@ -5,13 +5,13 @@ folder="/home/pi/mp4"
# 获取文件夹的大小 # 获取文件夹的大小
size=$(du -sh "$folder" | awk '{print int($1/1024/1024)}') size=$(du -sh "$folder" | awk '{print int($1/1024/1024)}')
while [[ $size -gt 22 ]] while [[ $size -gt 20 ]]
do do
# 获取最早创建的文件 # 获取最早创建的文件
oldest_file=$(ls -tr | head -1 | xargs) oldest_file=$(ls -tr | head -1 | xargs)
rm -f $oldest_file rm -f $oldest_file
size=$(du -sh "$folder" | awk '{print int($1/1024/1024)}') size=$(du -sh "$folder" | awk '{print int($1/1024/1024)}')
if [[ $size -le 22 ]] if [[ $size -le 20 ]]
then then
exit 0 exit 0
fi fi

View File

@ -37,4 +37,4 @@ stopsignal=TERM
stopasgroup=True stopasgroup=True
priority=1 priority=1
[include] [include]
files = /home/pi/lot_manager/conf/*.conf files = /etc/supervisor/conf.d/*.conf