diff --git a/influxdb/Dockerfile b/influxdb/Dockerfile
index df44a8293503bb1ef75d78afdd7bcfc1f8aa5dcb..25bf74075c568fe115dd41df9d20396252c0be61 100644
--- a/influxdb/Dockerfile
+++ b/influxdb/Dockerfile
@@ -7,4 +7,4 @@ COPY requirements.txt /usr/src/app
 RUN python3 -m pip install -r requirements.txt
 
 COPY influx_to_csv.py /usr/src/app
-CMD ["python3", "/usr/src/app/influx_to_csv.py"]
\ No newline at end of file
+CMD ["python3", "-u", "/usr/src/app/influx_to_csv.py"]
\ No newline at end of file
diff --git a/influxdb/influx_to_csv.py b/influxdb/influx_to_csv.py
index 2e40139feee20ed3c2b7d666a1d4b9a3607df08c..80760b8a9ed9cfc120c1c1fb64f7ccf6dfcc7367 100644
--- a/influxdb/influx_to_csv.py
+++ b/influxdb/influx_to_csv.py
@@ -3,34 +3,40 @@ import os
 from datetime import datetime, timedelta
 from pathlib import Path
 import csv
-
 from influxdb import InfluxDBClient
+from random import uniform
+
+# Start sensors at different time after
+time.sleep(uniform(10,60))
+print('Starting influx_to_csv')
 
 influx_host = os.getenv("INFLUX_HOST", "localhost")
 influx_client = InfluxDBClient(host=influx_host, database="multi-sense")
 
 write_time_interval = 60
 start_time = datetime.utcnow()
-begin = start_time - timedelta(seconds=100)
+begin = start_time - timedelta(seconds=3*write_time_interval)
 end = begin + timedelta(seconds=write_time_interval)
 
 csv_folder_path = os.getenv("CSV_FOLDER_PATH", "./data")
 data_folder = Path(csv_folder_path)
 data_folder.mkdir(parents=True, exist_ok=True)
+measurement = 'bme280'
 
 while True:
     begin += timedelta(seconds=write_time_interval)
     end += timedelta(seconds=write_time_interval)
-    query = 'select * from "bme280" where time > \'' + begin.isoformat() + "Z' AND time <= '" + end.isoformat() + "Z' tz('Europe/Paris')"
+    query = 'select * from "' + measurement + '" where time > \'' + begin.isoformat() + "Z' AND time <= '" + end.isoformat() + "Z' tz('Europe/Paris')"
     result = influx_client.query(query, epoch="ms")
+    #print(query)
 
     try:
         n = next(result.get_points())
     except StopIteration:
         print('Influxdb result query is empty')
     else:
-        file_date = datetime.now().strftime('%Y_%m_%d_%H_%M')
-        file_name = data_folder/str('bme280_' + file_date + '.csv')
+        file_date = datetime.now().strftime('%Y_%m_%d')
+        file_name = data_folder/str(measurement + '_' + file_date + '.csv')
         with file_name.open('a') as csvfile:
             fieldnames = list(next(result.get_points()).keys())
             writer = csv.DictWriter(csvfile, fieldnames)
diff --git a/sensors/ads1115/Dockerfile b/sensors/ads1115/Dockerfile
index 54a2a8f42fc655a108e94e2130c472767cdbf144..55ec5835ea7d025ef6ec2ac61528e8031f00cd0f 100644
--- a/sensors/ads1115/Dockerfile
+++ b/sensors/ads1115/Dockerfile
@@ -7,4 +7,4 @@ COPY requirements.txt /usr/src/app
 RUN python3 -m pip install -r requirements.txt
 
 COPY ads1115_influx.py /usr/src/app
-CMD ["python3", "/usr/src/app/ads1115_influx.py"]
\ No newline at end of file
+CMD ["python3", "-u", "/usr/src/app/ads1115_influx.py"]
\ No newline at end of file
diff --git a/sensors/ads1115/ads1115_influx.py b/sensors/ads1115/ads1115_influx.py
index 06479f8da4f1d81faade8973b5860377e3e2942c..0bae594f09bc476afc40b64a6eeb480f8dc456ee 100644
--- a/sensors/ads1115/ads1115_influx.py
+++ b/sensors/ads1115/ads1115_influx.py
@@ -8,6 +8,7 @@ from random import uniform
 
 # Start sensors at different time after
 time.sleep(uniform(10,60))
+print('Starting ads1115')
 
 influx_host = os.getenv('INFLUX_HOST', 'localhost')
 influx_dbname = os.getenv('INFLUX_DBNAME', 'multi-sense')
diff --git a/sensors/bme280/Dockerfile b/sensors/bme280/Dockerfile
index cff513af02540a72aae5287cc8a300b203bed10b..c92733e8330b80bfc6c1a9fe5499d9117047b6be 100644
--- a/sensors/bme280/Dockerfile
+++ b/sensors/bme280/Dockerfile
@@ -7,4 +7,4 @@ COPY requirements.txt /usr/src/app
 RUN python3 -m pip install -r requirements.txt
 
 COPY bme280_influx.py /usr/src/app
-CMD ["python3", "/usr/src/app/bme280_influx.py"]
+CMD ["python3", "-u", "/usr/src/app/bme280_influx.py"]
diff --git a/sensors/bme280/bme280_influx.py b/sensors/bme280/bme280_influx.py
index 4028143f75799c12aac0913d3b0e2c0ca77c0f21..316309c8b2881b7b417bc1d1fb51ba03d312b9ee 100644
--- a/sensors/bme280/bme280_influx.py
+++ b/sensors/bme280/bme280_influx.py
@@ -7,6 +7,7 @@ from random import uniform
 
 # Start sensors at different time after
 time.sleep(uniform(10,60))
+print('Starting bme280')
 
 influx_host = os.getenv('INFLUX_HOST', 'localhost')
 influx_dbname = os.getenv('INFLUX_DBNAME', 'multi-sense')
diff --git a/sensors/cpu_load/Dockerfile b/sensors/cpu_load/Dockerfile
index 8e84dc47b405108dd6e19221ad05e3f80e2d98f7..e475c8e8d9465f6726e1f7d801f20772efc186d6 100644
--- a/sensors/cpu_load/Dockerfile
+++ b/sensors/cpu_load/Dockerfile
@@ -7,4 +7,4 @@ COPY requirements.txt /usr/src/app
 RUN python3 -m pip install -r requirements.txt
 
 COPY cpu_load.py /usr/src/app
-CMD ["python3", "/usr/src/app/cpu_load.py"]
\ No newline at end of file
+CMD ["python3", "-u", "/usr/src/app/cpu_load.py"]
\ No newline at end of file
diff --git a/sensors/cpu_load/cpu_load.py b/sensors/cpu_load/cpu_load.py
index 66378e63c0f54d8affc918c2ac0f3b4741400d56..4f1144413787045f5ead385d1d7e1e5f5c5970de 100644
--- a/sensors/cpu_load/cpu_load.py
+++ b/sensors/cpu_load/cpu_load.py
@@ -6,6 +6,7 @@ from random import uniform
 
 # Start sensors at different time after
 time.sleep(uniform(10,60))
+print('Starting cpu_load')
 
 influx_host = os.getenv('INFLUX_HOST', 'localhost')
 influx_dbname = os.getenv('INFLUX_DBNAME', 'multi-sense')