diff --git a/echo-side/dags/monitor.py b/echo-side/dags/monitor.py index beb434c..a664cde 100644 --- a/echo-side/dags/monitor.py +++ b/echo-side/dags/monitor.py @@ -53,7 +53,7 @@ task_id='compare_csv_file_lists', image='ghcr.io/lsst-uk/csd3-echo-somerville:latest', cmds=['./entrypoint.sh'], - arguments=['python', 'csd3-echo-somerville/scripts/compare_csv_file_lists.py', '--path', '/lsst-backup-logs'], + arguments=['python', 'csd3-echo-somerville/scripts/compare_csv_file_lists.py', '--path', '/lsst-backup-logs', '--datestamp', '{{ ds_nodash }}'], dag=dag, volumes=[logs_volume], volume_mounts=[logs_volume_mount], diff --git a/scripts/compare_csv_file_lists.py b/scripts/compare_csv_file_lists.py index 7523b05..b417646 100644 --- a/scripts/compare_csv_file_lists.py +++ b/scripts/compare_csv_file_lists.py @@ -3,11 +3,13 @@ parser = argparse.ArgumentParser(description="Compare CSV file lists in a log folder.") parser.add_argument("--path", '-p', help="Path to the log folder", required=True) +parser.add_argument("--datestamp", '-d', help="Datestamp", required=True, help="Datestamp in the form YYYYMMDD") args = parser.parse_args() log_folder = args.path +datestamp = args.datestamp -def compare_csv_file_lists(log_folder): +def compare_csv_file_lists(log_folder, ds): """ Compare the CSV file lists in the specified log folder. @@ -19,7 +21,6 @@ def compare_csv_file_lists(log_folder): """ csv_files = [] for filename in os.listdir(log_folder): - ds = '{{ ds_nodash }}' print(filename,ds) if filename.startswith("lsst-backup-logs-"): if filename.endswith(".csv"): @@ -31,4 +32,4 @@ def compare_csv_file_lists(log_folder): print(csv_files) if __name__ == "__main__": - compare_csv_file_lists(log_folder) \ No newline at end of file + compare_csv_file_lists(log_folder, datestamp) \ No newline at end of file