linux - 用于检查文件准确性的 shell 脚本
问题描述
我有脚本可以检查删除了多少桶的准确性。我想要编写一个脚本,一旦上述脚本停止运行,它就可以帮助我,它必须再次检查文件并且有任何剩余的存储桶创建一个输入列表并在其余存储桶上运行第二个“rm -rf”然后重复自身直到他们都走了。请在下面找到脚本:
#!/bin/bash
rm /tmp/buckets_to_remove/*
# Ensure that the /tmp/buckets_to_remove directory exists and if not then create it
if [ ! -d /tmp/buckets_to_remove ]
then
mkdir /tmp/buckets_to_remove
fi
please find the error below:
Removing bucket act/1473823073_1459448859_XXXXX
Removing bucket act/1453904759_1438082433_XXXXX
Removing bucket act/1477122647_1442503432_XXXXX
Removing bucket asa/1473740503_1472875269_XXXXX
Removing bucket asa/1473741465_1473740502_XXXXX
Removing bucket asa/1473740504_1473740502_XXXXX
解决方案
这是你想要的?
该rm
命令将每 15 秒连续运行一次。
#!/bin/bash
# Ensure that the /tmp/buckets_to_remove directory exists and if not then create it
if [ ! -d /tmp/buckets_to_remove ]
then
mkdir /tmp/buckets_to_remove
fi
while(true)
do
for rmbuckets in $( ( ls /tmp/buckets_to_remove/ ) )
do
rm "$rmbuckets"
done
sleep 15
done
推荐阅读
- php - Php / Laravel 多文件上传错误 - 未定义的偏移量
- android - Material Components 底部导航视图
- javascript - 导入不适用于 babel 和 webpack
- android - 如何从Dialogfragment获取数据到带有接口的片段
- windows - 从具有相同文件名的多个目录中批量复制文件
- docker - 什么是 Docker 频道?
- python - Matplotlib 2 y轴与平均值
- git - 这些符号在 git pull 中是什么意思?
- asp.net - ASP.Net MVC 引导网格无法正常工作
- laravel - 服务器冻结在 index.php laravel 中进行发布请求