@@ -48,6 +48,10 @@ def jira_scraper():
4848 )
4949 parser .add_argument ("--recreate_collection" , action = 'store_true' , default = False ,
5050 help = "Recreate database collection from scratch." )
51+ parser .add_argument ("--backup" , action = 'store_true' , default = False ,
52+ help = "Save a scraper output to file" )
53+ parser .add_argument ("--backup_path" , type = str ,
54+ default = "all_data.pickle" )
5155 args = parser .parse_args ()
5256
5357 config_args = {
@@ -65,6 +69,8 @@ def jira_scraper():
6569 "date_cutoff" : args .date_cutoff ,
6670 "scraper_processes" : args .scraper_processes ,
6771 "recreate_collection" : args .recreate_collection ,
72+ "backup" : args .backup ,
73+ "backup_path" : args .backup_path ,
6874 }
6975
7076 scraper = JiraScraper (config_args )
@@ -100,6 +106,10 @@ def osp_doc_scraper():
100106 parser .add_argument (
101107 "--rhoso_docs_path" , type = str , default = "" ,
102108 help = "Path to downstream RHOSO docs generated by get_rhoso_plaintext_docs.sh" )
109+ parser .add_argument ("--backup" , action = 'store_true' , default = False ,
110+ help = "Save a scraper output to file" )
111+ parser .add_argument ("--backup_path" , type = str ,
112+ default = "osp_all_docs.pickle" )
103113 args = parser .parse_args ()
104114
105115 config_args = {
@@ -114,6 +124,8 @@ def osp_doc_scraper():
114124 "osp_version" : args .osp_version ,
115125 "recreate_collection" : args .recreate_collection ,
116126 "rhoso_docs_path" : args .rhoso_docs_path ,
127+ "backup" : args .backup ,
128+ "backup_path" : args .backup_path ,
117129 }
118130
119131 scraper = OSPDocScraper (config_args )
@@ -156,6 +168,10 @@ def errata_scraper() -> None:
156168 )
157169 parser .add_argument ("--recreate_collection" , action = 'store_true' , default = False ,
158170 help = "Recreate database collection from scratch." )
171+ parser .add_argument ("--backup" , action = 'store_true' , default = False ,
172+ help = "Save a scraper output to file" )
173+ parser .add_argument ("--backup_path" , type = str ,
174+ default = "errata_all_data.pickle" )
159175 args = parser .parse_args ()
160176
161177 config_args = {
@@ -176,6 +192,8 @@ def errata_scraper() -> None:
176192 "scraper_processes" : args .scraper_processes ,
177193 "date_cutoff" : args .date_cutoff ,
178194 "recreate_collection" : args .recreate_collection ,
195+ "backup" : args .backup ,
196+ "backup_path" : args .backup_path ,
179197 }
180198
181199 scraper = ErrataScraper (config_args )
@@ -215,6 +233,10 @@ def ci_logs_scraper() -> None:
215233 default = constants .DEFAULT_ZULL_TENANTS )
216234 parser .add_argument ("--populate_db_from_json" , type = bool , default = False ,
217235 help = "Used from Zuul jobs that create json file at the end of their runs." )
236+ parser .add_argument ("--backup" , action = 'store_true' , default = False ,
237+ help = "Save a scraper output to file" )
238+ parser .add_argument ("--backup_path" , type = str ,
239+ default = "aci_logs_all_data.pickle" )
218240 args = parser .parse_args ()
219241
220242 config_args = {
@@ -230,7 +252,9 @@ def ci_logs_scraper() -> None:
230252 "recreate_collection" : args .recreate_collection ,
231253 "pipelines" : args .pipelines ,
232254 "tenants" : args .tenants ,
233- "tracebacks_json" : "/tmp/tracebacks.json"
255+ "tracebacks_json" : "/tmp/tracebacks.json" ,
256+ "backup" : args .backup ,
257+ "backup_path" : args .backup_path ,
234258 }
235259
236260
@@ -277,6 +301,10 @@ def solutions_scraper() -> None:
277301 default = constants .SOLUTIONS_PRODUCT_NAME )
278302 parser .add_argument ("--recreate_collection" , action = 'store_true' , default = False ,
279303 help = "Recreate database collection from scratch." )
304+ parser .add_argument ("--backup" , action = 'store_true' , default = False ,
305+ help = "Save a scraper output to file" )
306+ parser .add_argument ("--backup_path" , type = str ,
307+ default = "solutions_all_data.csv" )
280308 args = parser .parse_args ()
281309
282310 config_args = {
@@ -292,6 +320,8 @@ def solutions_scraper() -> None:
292320 "product_name" : args .product_name ,
293321 "max_results" : args .max_results ,
294322 "recreate_collection" : args .recreate_collection ,
323+ "backup" : args .backup ,
324+ "backup_path" : args .backup_path ,
295325 }
296326
297327 scraper = SolutionsScraper (config_args )
0 commit comments