This commit is contained in:
xyj 2023-12-12 11:45:26 +08:00
parent 8a3a5885f8
commit 2eb08f85f5
3 changed files with 8 additions and 7 deletions

View File

@ -1,9 +1,5 @@
# 公共定时任务
# 每小时0分执行
0 * * * * /usr/bin/bash /home/pi/lot_manager/bash/cron_delete_mp4.sh
# 每天00分执行 # 每天00分执行
0 0 * * * /usr/bin/python /home/pi/lot_manager/delete_lot_data_3_days.py 0 0 * * * /usr/bin/python /home/pi/lot_manager/delete_lot_data_3_days.py
# 针对32G内存卡的定时额外加这个 # 针对32G内存卡的定时额外加这个
# 每隔15分钟进行 # 每隔15分钟进行
*/15 * * * * /usr/bin/python /home/pi/lot_manager/delete_than20G.py */15 * * * * /usr/bin/python /home/pi/lot_manager/delete_than20G.py

View File

@ -0,0 +1,5 @@
# 公共定时任务
# 每小时0分执行,32G的不用加
0 * * * * /usr/bin/bash /home/pi/lot_manager/bash/cron_delete_mp4.sh
# 每天00分执行
0 0 * * * /usr/bin/python /home/pi/lot_manager/delete_lot_data_3_days.py

View File

@ -17,8 +17,8 @@ while True:
oldest_file = min(files_info, key=lambda x: x[0])[1] oldest_file = min(files_info, key=lambda x: x[0])[1]
# 删除最旧的文件 # 删除最旧的文件
os.remove(os.path.join(folder_path, oldest_file)) os.remove(os.path.join(folder_path, oldest_file))
# print("删除文件" + oldest_file)
else: else:
# print("文件夹小于20G") # print("文件夹小于20G")
break break
# 等待5秒钟 time.sleep(2)
time.sleep(1)