-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmulti-download.sh
41 lines (27 loc) · 1.08 KB
/
multi-download.sh
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
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/bash/
start_date="2010-01-01" # set the initial date.
end_date=`date -d $start_date' 2 months' '+%Y-%m-%d'`
end_date=`date -d $end_date' 1 days ago' '+%Y-%m-%d'`
echo $start_date
echo $end_date
echo '############'
sed -i -e '34,34d' downloader.py
sed -i -e '34,34d' downloader.py
sed -i '34i \min_upload_date = '\'$start_date\'',' downloader.py
sed -i '35i \max_upload_date = '\'$end_date\'',' downloader.py
python3 downloader.py $start_date'_'$end_date
############################################################################
for year in `seq 119` # Set the months you want to search. (number should be 'months - 1')
do
start_date=`date -d $end_date' 1 days' '+%Y-%m-%d'`
end_date=`date -d $start_date' 2 months' '+%Y-%m-%d'`
end_date=`date -d $end_date' 1 days ago' '+%Y-%m-%d'`
echo $start_date
echo $end_date
echo '############'
sed -i -e '34,34d' downloader.py
sed -i -e '34,34d' downloader.py
sed -i '34i \min_upload_date = '\'$start_date\'',' downloader.py
sed -i '35i \max_upload_date = '\'$end_date\'',' downloader.py
python3 downloader.py $start_date'_'$end_date
done