文章目录
  1. 1. Clear.sh
  2. 2. Merge.sh
  3. 3. tar.sh

Clear.sh

1
2
3
4
5
6
7
8
9
10
11
12
	#!/bin/bash

folders=(everyone snapshot top total_100 total_250)

cd /data/plattech/tmp/bi_develop_tmp_for_wcl/ga
<!-- more -->
for var in ${folders[@]};do
ls ${var}/*.txt | grep -v "unit"
mv -f ${var}/*.txt ${var}/old
done

echo "Success."

Merge.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

games=(tank world_war toy_war red_fire war_commander)

cd /data/plattech/tmp/bi_develop_tmp_for_wcl/ga/total
for var in ${games[@]};do
:> ${var}_order_250.txt
for (( i=1; i<250; i=i+50 ));do
if [ -f "${var}_order_${i}.txt" ]
then
echo "${var}_order_${i}.txt"
cat ${var}_order_${i}.txt >> ${var}_order_250.txt
fi
if [ $i == 51 ]
then
cp ${var}_order_250.txt ../total_100/${var}_order_100.txt
fi
done
mv -f ${var}_order_250.txt ../total_250
done

echo "Success."

tar.sh

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

folders=(everyone snapshot top total_100 total_250)

cd /data/plattech/tmp/bi_develop_tmp_for_wcl/ga

for var in ${folders[@]};do
tar -cvzf ${var}/${var}.tar.gz ${var}/*.txt
mv -f ${var}/${var}.tar.gz download
done

echo "Success.\n"
文章目录
  1. 1. Clear.sh
  2. 2. Merge.sh
  3. 3. tar.sh