changeset 1:f0c4f7f2ecd4 draft

Uploaded
author greg
date Mon, 19 Aug 2019 13:26:54 -0400
parents 572cf766c59d
children 681d8497a691
files update_stag_database.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/update_stag_database.py	Thu Aug 15 13:08:33 2019 -0400
+++ b/update_stag_database.py	Mon Aug 19 13:26:54 2019 -0400
@@ -201,7 +201,12 @@
     def get_config_settings(self):
         config_defaults = get_config_settings(self.args.config_file)
         self.db_name = get_value_from_config(config_defaults, 'DB_NAME')
-        self.db_storage_dir = get_value_from_config(config_defaults, 'DB_STORAGE_DIR')
+        base_storage_dir = get_value_from_config(config_defaults, 'DB_STORAGE_DIR')
+        # Use the date to name the storage directory to
+        # enable storing a file per day (multiple runs
+        # per day will overwrite the existing file.
+        date_str = datetime.datetime.now().strftime("%Y_%m_%d")
+        self.db_storage_dir = os.path.join(base_storage_dir, date_str)
 
     def get_next_sample_id(self):
         cmd = "SELECT sample_id FROM sample ORDER by id DESC;"