This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·96 lines (72 loc) · 2.9 KB
/
entrypoint.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# Give time to selenium standalone to start up
sleep 1m
# by_state_yearly and by_state_monthly
nohup Rscript make_data.R 2015 2022 "Todos" "" "Todos" "./merged_data/by_state_yearly.csv" > /home/brazil-death-data/merged_data/by_state_yearly.out &
job1=$!
echo "Starting job $job1"
nohup Rscript make_data.R 2015 2022 "1" "12" "Todos" "./merged_data/by_state_monthly.csv" > /home/brazil-death-data/merged_data/by_state_monthly.out &
job2=$!
echo "Starting job $job2"
wait $job1
echo "Finished job $job1"
wait $job2
echo "Finished job $job2"
# by_city_yearly
nohup Rscript make_data.R 2015 2022 "Todos" "" "" "./merged_data/by_city_yearly.csv" > /home/brazil-death-data/merged_data/by_city_yearly.out &
job=$!
echo "Starting job $job"
wait $job
echo "Finished job $job"
# by_city_monthly from month 1 to 3
nohup Rscript make_data.R 2015 2017 "1" "3" "" "./merged_data/by_city_monthly1.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job1=$!
echo "Starting job $job1"
nohup Rscript make_data.R 2018 2022 "1" "3" "" "./merged_data/by_city_monthly2.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job2=$!
echo "Starting job $job2"
wait $job1
echo "Finished job $job1"
wait $job2
echo "Finished job $job2"
# by_city_monthly from month 4 to 6
nohup Rscript make_data.R 2015 2017 "4" "6" "" "./merged_data/by_city_monthly3.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job1=$!
echo "Starting job $job1"
nohup Rscript make_data.R 2018 2022 "4" "6" "" "./merged_data/by_city_monthly4.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job2=$!
echo "Starting job $job2"
wait $job1
echo "Finished job $job1"
wait $job2
echo "Finished job $job2"
# by_city_monthly from month 7 to 9
nohup Rscript make_data.R 2015 2017 "7" "9" "" "./merged_data/by_city_monthly5.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job1=$!
echo "Starting job $job1"
nohup Rscript make_data.R 2018 2022 "7" "9" "" "./merged_data/by_city_monthly6.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job2=$!
echo "Starting job $job2"
wait $job1
echo "Finished job $job1"
wait $job2
echo "Finished job $job2"
# by_city_monthly 10 to 12
nohup Rscript make_data.R 2015 2017 "10" "12" "" "./merged_data/by_city_monthly7.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job1=$!
echo "Starting job $job1"
nohup Rscript make_data.R 2018 2022 "10" "12" "" "./merged_data/by_city_monthly8.csv" > /home/brazil-death-data/merged_data/by_city_monthly.out &
job2=$!
echo "Starting job $job2"
wait $job1
echo "Finished job $job1"
wait $job2
echo "Finished job $job2"
# merge all by_city_monthly files
nohup Rscript merge_data.R > /home/brazil-death-data/merged_data/merge_data.out
# remove unnecessary files
for i in {1..8}
do
rm /home/brazil-death-data/merged_data/by_city_monthly$i.csv
done
Rscript last_run_check.R >> /home/brazil-death-data/merged_data/last_run.txt