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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import os
import sys
import time
sys.path.append(os.path.dirname(sys.path[0]))
from utils.ssh_util import SSHUtil
from utils.common_util import CommonUtil
if __name__ == '__main__':
days = [
# "2022-07-27",
# "2022-07-28",
# "2022-07-29",
# "2022-08-29",
# "2022-08-30",
# "2022-09-26",
# "2022-11-01",
# "2022-11-28",
# "2022-12-26",
"2023-01-30",
"2023-02-23",
"2023-02-24",
"2023-02-25",
"2023-02-26",
"2023-02-27",
"2023-02-28",
"2023-03-01",
"2023-03-02",
"2023-03-03",
"2023-03-04",
"2023-03-05",
"2023-03-06",
"2023-03-07",
"2023-03-08",
"2023-03-09",
"2023-03-10",
"2023-03-11",
"2023-03-12",
"2023-03-13",
"2023-03-14",
"2023-03-15",
"2023-03-16",
"2023-03-17",
"2023-03-18",
"2023-03-19",
"2023-03-20",
"2023-03-21",
"2023-03-22",
"2023-03-23",
"2023-03-24",
"2023-03-25",
"2023-03-26",
"2023-03-27",
"2023-03-28",
"2023-03-29",
"2023-03-30",
"2023-03-31",
"2023-04-01",
"2023-04-02",
"2023-04-03",
"2023-04-04",
"2023-04-05",
"2023-04-06",
"2023-04-07",
"2023-04-08",
"2023-04-09",
"2023-04-11",
"2023-04-13",
"2023-04-14",
"2023-04-15",
"2023-04-16",
"2023-04-17",
"2023-04-18",
"2023-04-19",
"2023-04-20",
"2023-04-21",
"2023-04-22",
"2023-04-23",
"2023-04-24",
"2023-04-25",
"2023-04-26",
"2023-04-27",
"2023-04-28",
"2023-04-29",
"2023-04-30",
"2023-05-01",
"2023-05-05",
"2023-05-06",
"2023-05-08",
"2023-05-09",
"2023-05-10",
"2023-05-11",
"2023-05-12",
"2023-05-13",
"2023-05-14",
"2023-05-15",
"2023-05-17",
"2023-05-18",
"2023-05-19",
"2023-05-22",
"2023-05-23",
"2023-05-24",
"2023-05-25",
"2023-05-26",
]
client = SSHUtil.get_ssh_client()
for day in days:
sh = rf"""
/opt/module/anaconda3/envs/pyspark/bin/python3.8 /opt/module/spark/demo/py_demo/sqoop_export/dwd_bsr_asin_rank.py us {day}
"""
SSHUtil.exec_command_async(client, sh, ignore_err=False)
time.sleep(2)
pass
CommonUtil.send_wx_msg(['wujicang'], "提醒", "BSR历史数据导出重跑成功!!")