From a51dec5c0158a2275ca9c1aca0715666b4cd2aac Mon Sep 17 00:00:00 2001 From: Aris Paschalidis Date: Mon, 9 May 2022 12:52:21 -0400 Subject: [PATCH] Combine the two `nohup.out` files and force the mv command * Combine the nohup files to simplify the logs * Force the mv command so that the app can still run even if there is a previous run. The app will overwrite the needed files. --- docs/guides/analysis-pipeline.rst | 8 ++++---- src/generate_wrangler_scripts.py | 16 ++++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/guides/analysis-pipeline.rst b/docs/guides/analysis-pipeline.rst index b02fbd7..667e75f 100644 --- a/docs/guides/analysis-pipeline.rst +++ b/docs/guides/analysis-pipeline.rst @@ -77,10 +77,10 @@ Next, we can run the :ref:`wrangler app `: -s ${sample_sets_used} -c ${cpu_number} -m ${min_capture_length} The :ref:`wrangler app ` will save the main outputs as compressed -files in the :code:`wrangler` directory. There will additionally be two -:code:`nohup` files that contain errors and warning messages logged by the -:ref:`wrangler app `. These files should be empty if the all went -well. In our example run, both :code:`nohup` files were empty and the main +files in the :code:`wrangler` directory. There will additionally be a +:code:`nohup` file that contains errors and warning messages logged by the +:ref:`wrangler app `. This file should be empty if the all went +well. In our example run, the :code:`nohup` file was empty and the main outputs were aggregated into the three files: * :code:`run_test_run_wrangled_20220314.txt.gz` diff --git a/src/generate_wrangler_scripts.py b/src/generate_wrangler_scripts.py index 0bc367b..5bacaea 100644 --- a/src/generate_wrangler_scripts.py +++ b/src/generate_wrangler_scripts.py @@ -326,17 +326,13 @@ str(server_num), str(cpu_count), str(args["population_fraction_cutoff"]), + ">>", + os.path.join(analysis_dir, "nohup.out"), ], - ["mv", os.path.join(analysis_dir, "analysis/logs"), analysis_dir], - ["mv", os.path.join(analysis_dir, "analysis/scripts"), analysis_dir], - ["mv", os.path.join(analysis_dir, "analysis/resources"), analysis_dir], - [ - "mv", - os.path.join(analysis_dir, "analysis/nohup.out"), - os.path.join(analysis_dir, "nohup2.out"), - "2>/dev/null ||true", - ], - ["mv", info_file, renamed_info], + ["mv -f", os.path.join(analysis_dir, "analysis/logs"), analysis_dir], + ["mv -f", os.path.join(analysis_dir, "analysis/scripts"), analysis_dir], + ["mv -f", os.path.join(analysis_dir, "analysis/resources"), analysis_dir], + ["mv -f", info_file, renamed_info], ["pigz", "-9", "-p", str(cpu_count), renamed_info], ] extraction_summary_file = "extractInfoSummary.txt"