Skip to content

Commit 68bd01d

Browse files
ku-weASDFGamer
andauthored
Add compose project name to generated rsnapshot configuration (#28)
Alter generated rsnapshot configuration. As service names are not unique, this change helps identifying the container and compose project for which the rsnapshot configuration is generated. Before: ``` #Start app-1 #runtime_backup [...] #Start app-1 #runtime_backup [...] ``` After: ``` ##Start backup for compose project wikicomposeProj1 - service app-1 #runtime_backup [...] ##Start backup for compose project wikicomposeProj2 - service app-1 #runtime_backup [...] ``` --------- Co-authored-by: Christoph Wildhagen <git@christoph-wildhagen.de>
1 parent 8e17bc2 commit 68bd01d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/rsnapshot_docker_compose_backup/container.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,17 @@ def backup(self) -> str:
4040
if output is None:
4141
# print("output is none")
4242
return ""
43-
result.append("#Start {}".format(self.service_name))
43+
result.append(
44+
"##Start backup for compose project {} - service {}".format(
45+
self.project_name, self.service_name
46+
)
47+
)
4448
result.append(output)
49+
result.append(
50+
"##End backup for compose project {} - service {}".format(
51+
self.project_name, self.service_name
52+
)
53+
)
4554
result.append("")
4655
return "\n".join(result)
4756

0 commit comments

Comments
 (0)