mqtt
This commit is contained in:
parent
241a2e766f
commit
f5c5e6945c
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
# 指定文件夹路径
|
||||
folder="/home/pi/mp4"
|
||||
|
||||
# 获取文件夹的大小
|
||||
size=$(du -sh "$folder" | awk '{print int($1/1024/1024)}')
|
||||
echo $size
|
||||
while [[ $size -gt 24 ]]
|
||||
do
|
||||
# 获取最早创建的文件
|
||||
oldest_file=$(ls -tr | head -1 | xargs)
|
||||
echo $oldest_file
|
||||
rm -f $oldest_file
|
||||
size=$(du -sh "$folder" | awk '{print int($1/1024/1024)}')
|
||||
if [[ $size -le 24 ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
RTSP_URL="rtsp://admin:123456@192.168.0.123:554/mpeg4" # RTSP流的URL
|
||||
OUTPUT_DIR="/home/pi/mp4" # 录像文件保存的目录
|
||||
RECORD_DURATION=60 # 录像时长(秒)
|
||||
INTERNAL=1
|
||||
INTERNAL=2
|
||||
while true; do
|
||||
# 获取当前时间
|
||||
CURRENT_TIME=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
|
|
Loading…
Reference in New Issue