Fix config unit and improve log
diff --git a/etc/staffeln/staffeln.conf b/etc/staffeln/staffeln.conf
index 13cfacf..3ba6d5a 100644
--- a/etc/staffeln/staffeln.conf
+++ b/etc/staffeln/staffeln.conf
@@ -1,17 +1,21 @@
[conductor]
backup_workers = 1
rotation_workers = 1
-backup_service_period = 20
-retention_service_period = 20
+# 20mins
+backup_service_period = 1200
+# 20mins
+retention_service_period = 1200
# 1y2mon10d5h30min10s
backup_cycle_timout = 5min
retention_time = 2w3d
backup_metadata_key="__automated_backup"
retention_metadata_key="__staffeln_retention"
+full_backup_depth = 4
[database]
backend = sqlalchemy
connection = "mysql+pymysql://root:password@localhost:3306/staffeln"
+tooz_connection = "mysql://root:password@localhost:3306/staffeln"
mysql_engine = InnoDB
# mysql_sql_mode = TRADITIONAL
# idle_timeout = 3600
diff --git a/staffeln/conductor/backup.py b/staffeln/conductor/backup.py
index 2d8214d..2d0d8a7 100755
--- a/staffeln/conductor/backup.py
+++ b/staffeln/conductor/backup.py
@@ -98,6 +98,8 @@
:param old_tasks: Task list not completed in the previous cycle
:type: List<Class objects.Queue>
"""
+
+ LOG.info("Adding new backup tasks to queue.")
# 1. get the old task list, not finished in the last cycle
# and keep till now
old_task_volume_list = []
@@ -105,10 +107,10 @@
old_task_volume_list.append(old_task.volume_id)
# 2. add new tasks in the queue which are not existing in the old task list
- queue_list = self.check_instance_volumes()
- for queue in queue_list:
- if queue.volume_id not in old_task_volume_list:
- self._volume_queue(queue)
+ task_list = self.check_instance_volumes()
+ for task in task_list:
+ if task.volume_id not in old_task_volume_list:
+ self._volume_queue(task)
# Backup the volumes attached to which has a specific metadata
def filter_by_server_metadata(self, metadata):
@@ -132,7 +134,7 @@
res = volume["status"] in ("available", "in-use")
if not res:
reason = _(
- "Volume %s is not backed because it is in %s status"
+ "Volume %s is not triger new backup task because it is in %s status"
% (volume_id, volume["status"])
)
LOG.info(reason)
diff --git a/staffeln/conf/conductor.py b/staffeln/conf/conductor.py
index 772987a..086ce49 100755
--- a/staffeln/conf/conductor.py
+++ b/staffeln/conf/conductor.py
@@ -19,15 +19,15 @@
),
cfg.IntOpt(
"backup_service_period",
- default=30,
- min=10,
- help=_("The time of bakup period, the unit is one minute."),
+ default=1800,
+ min=600,
+ help=_("The time of bakup period, the unit is one second."),
),
cfg.IntOpt(
"report_period",
default=1440,
min=10,
- help=_("The time of report period, the unit is one minute."),
+ help=_("The time of report period, the unit is one second."),
),
cfg.StrOpt(
"backup_cycle_timout",