!/bin/bash 设置Hadoop路径 hadoop_path="/path/to/hadoop" 获取当前日期 current_date=$(date+%Y-%m-%d) 获取Hadoop集群中各个目录的总空间大小,并保存到文件 $hadoop_path/bin/hdfsdfs-du-s-h/user>current_space.txt 用awk命令提取目录名称和空间大小,并保存到文件 awk'{print$1,$2}'current_space.txt>current_space_formatted.txt 检查上一次记录的空间文件是否存在 if[-flast_...

  GHNks4L1uRVI   2023年11月02日   34   0   0 sed当前日期hdfs

!/bin/bash Elasticsearch集群的URL es_url="http://localhost:9200" 索引名称的前缀(假设索引名称为"logs-2023.06.15") index_prefix="logs-" 获取当前日期 current_date=$(date+%Y.%m.%d) 获取前一天的日期 previous_date=$(date-d"yesterday"+%Y.%m.%d) 构建前一天和当前日期的索引名称 previous_index="${index_prefix}${previous_date}" current_index="${index...

  GHNks4L1uRVI   2023年11月02日   33   0   0 Elastic当前日期bash
关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~