update
This commit is contained in:
parent
ed61de0b10
commit
23affef16d
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue