使用 shell 遍历日期

遍历日期

1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash                                                                                                                        
beg_date=`date -d "$1" +%s`
end_date=`date -d "$2" +%s`

echo ${beg_date}, ${end_date}

for (( i=${beg_date};i<=${end_date};i=i+86400))
do
day=`date -d @${i} "+%Y-%m-%d"`
echo ${day}
./diyiqi.sh $3 $4 $5 -d ${day}
sleep 360
done

Argument list too long

1
find . -name "spark-*" | xargs rm -rf "spark-*"

Argument list too long