-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmv_reports.sh
More file actions
executable file
·30 lines (26 loc) · 1012 Bytes
/
mv_reports.sh
File metadata and controls
executable file
·30 lines (26 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
mv_Daily='url1'
mv_Pull='url2'
mv_Daily_size=`wget --no-check-certificate -O - $mv_Daily | grep reports.tar | wc -l`
echo $mv_Daily_size
for i in $(seq 1 ${mv_Daily_size})
do
mv_Daily_url=`wget --no-check-certificate -O - $mv_Daily | grep reports.tar | grep -Po 'href="\K.*?(?=")' | head -n ${i} | tail -1`
echo $mv_Daily_url
mv_Daily_file=`echo $mv_Daily"/"$mv_Daily_url`
echo "************"$mv_Daily_file"*************"
wget --no-check-certificate $mv_Daily_file
tar -xvf $mv_Daily_url -C Daily
rm $mv_Daily_url
done
mv_Pull_size=`wget --no-check-certificate -O - $mv_Pull | grep reports.tar | wc -l`
echo $mv_Pull_size
for i in $(seq 1 ${mv_Pull_size})
do
mv_Pull_url=`wget --no-check-certificate -O - $mv_Pull | grep reports.tar | grep -Po 'href="\K.*?(?=")' | head -n ${i} | tail -1`
echo $mv_Pull_url
mv_Pull_file=`echo $mv_Pull"/"$mv_Pull_url`
echo "************"$mv_Pull_file"*************"
wget --no-check-certificate $mv_Pull_file
tar -xvf $mv_Pull_url -C Pull
rm $mv_Pull_url
done