From bac768d43932645a3290d5dd530e970e18f92b2b Mon Sep 17 00:00:00 2001 From: jdhayhurst Date: Tue, 26 Jul 2022 09:27:44 +0100 Subject: [PATCH 1/2] fix file paths --- ftpSummaryStatsScript/ftp_sync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftpSummaryStatsScript/ftp_sync.py b/ftpSummaryStatsScript/ftp_sync.py index ea7d2d5..b7ff732 100755 --- a/ftpSummaryStatsScript/ftp_sync.py +++ b/ftpSummaryStatsScript/ftp_sync.py @@ -201,7 +201,7 @@ def release_files_for_harmonisation(self): def update_lastrun_file(self): datestamp = self.generate_datestamp() - with open(file, "a+") as f: + with open(self.lastrun_file, "a+") as f: f.write(datestamp + '\n') @staticmethod @@ -270,7 +270,7 @@ def sync_to_ftp(self): self._generate_md5sums_for_contents(source) pardir = self._create_pardir_on_dest(source) if pardir: - dest_dir = os.path.join(self.pardir, study + "/") + dest_dir = os.path.join(pardir, study + "/") self.rsync_dir(source, dest_dir) logger.info("==========================================") From e6470d53195dd26fa0097f830f4f8149fa7fd6bd Mon Sep 17 00:00:00 2001 From: jdhayhurst Date: Wed, 31 Aug 2022 10:22:57 +0100 Subject: [PATCH 2/2] fixing the harmonisation queuing --- ftpSummaryStatsScript/ftp_sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ftpSummaryStatsScript/ftp_sync.py b/ftpSummaryStatsScript/ftp_sync.py index b7ff732..b9e520e 100755 --- a/ftpSummaryStatsScript/ftp_sync.py +++ b/ftpSummaryStatsScript/ftp_sync.py @@ -196,7 +196,8 @@ def release_files_for_harmonisation(self): for study in self.get_files_to_harmonise(): logger.info("{} --> harmonisation queue".format(study)) source = self.staging_studies_dict[study] - dest_dir = self.harmonise_path + "/" + dest_dir = os.path.join(self.harmonise_path, study) + self.make_dir(dest_dir) self.rsync_dir(source, dest_dir) def update_lastrun_file(self):