diff --git a/conf/example/cron.conf b/conf/example/cron_for_32G.conf similarity index 66% rename from conf/example/cron.conf rename to conf/example/cron_for_32G.conf index c0ea1e5..595e72b 100644 --- a/conf/example/cron.conf +++ b/conf/example/cron_for_32G.conf @@ -1,9 +1,5 @@ -# 公共定时任务 -# 每小时0分执行 -0 * * * * /usr/bin/bash /home/pi/lot_manager/bash/cron_delete_mp4.sh # 每天0:0分执行 0 0 * * * /usr/bin/python /home/pi/lot_manager/delete_lot_data_3_days.py - # 针对32G内存卡的定时,额外加这个 # 每隔15分钟进行 -*/15 * * * * /usr/bin/python /home/pi/lot_manager/delete_than20G.py +*/15 * * * * /usr/bin/python /home/pi/lot_manager/delete_than20G.py \ No newline at end of file diff --git a/conf/example/cron_for_64G.conf b/conf/example/cron_for_64G.conf new file mode 100644 index 0000000..b853aa3 --- /dev/null +++ b/conf/example/cron_for_64G.conf @@ -0,0 +1,5 @@ +# 公共定时任务 +# 每小时0分执行,32G的不用加 +0 * * * * /usr/bin/bash /home/pi/lot_manager/bash/cron_delete_mp4.sh +# 每天0:0分执行 +0 0 * * * /usr/bin/python /home/pi/lot_manager/delete_lot_data_3_days.py \ No newline at end of file diff --git a/delete_than20G.py b/delete_than20G.py index ac603d2..4b3d483 100644 --- a/delete_than20G.py +++ b/delete_than20G.py @@ -17,8 +17,8 @@ while True: oldest_file = min(files_info, key=lambda x: x[0])[1] # 删除最旧的文件 os.remove(os.path.join(folder_path, oldest_file)) + # print("删除文件" + oldest_file) else: # print("文件夹小于20G") break - # 等待5秒钟 - time.sleep(1) + time.sleep(2)