添加脚本,定时删除一个月以上的包

main
PC-202302260912\Administrator 2023-07-25 16:34:31 +08:00
parent 8e6b3a6473
commit 2c34eb0b04
1 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#!/bin/bash
# 指定目标目录
target_dir="/data/update/package"
# 使用find命令找到目标文件并删除超过一个月的文件
find "$target_dir" -maxdepth 1 -type f -mtime +30 -exec rm -f {} \;