# HG changeset patch # User greg # Date 1566235614 14400 # Node ID f0c4f7f2ecd4116a833882d9c7f6b1c7509f4056 # Parent 572cf766c59dec8ee57ecedeed312c43fa5e259a Uploaded diff -r 572cf766c59d -r f0c4f7f2ecd4 update_stag_database.py --- 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;"