backup-docker-to-local 1.4.0__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/METADATA +1 -1
- {backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/RECORD +7 -7
- baudolo/backup/app.py +44 -4
- {backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/WHEEL +0 -0
- {backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/entry_points.txt +0 -0
- {backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/licenses/LICENSE +0 -0
- {backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
backup_docker_to_local-1.
|
|
1
|
+
backup_docker_to_local-1.5.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
2
2
|
baudolo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
baudolo/backup/__init__.py,sha256=5BfF8JBXB2j6sAptcmswtbjlajNWxOho6_CjwIamO7k,30
|
|
4
4
|
baudolo/backup/__main__.py,sha256=118gZ0wij9_PAtR-jlG7LizrhrxwhHlAcAPW1eFeJtU,140
|
|
5
|
-
baudolo/backup/app.py,sha256=
|
|
5
|
+
baudolo/backup/app.py,sha256=eUJajqvXudc5B3cGDofx9NvoBSE-Nc0hx1pAb7aUN_I,7872
|
|
6
6
|
baudolo/backup/cli.py,sha256=CIckfVsU03ajZTI7zj3TB-AuvaOeJMbTB6rNCOKymXE,2473
|
|
7
7
|
baudolo/backup/compose.py,sha256=b-qKimuCcNhvHvDNDyNhmtDPcBpN2pmlJNBgy2fiPg0,3637
|
|
8
8
|
baudolo/backup/db.py,sha256=_7_Vy8nMql1vaaL1g0kbLtRHhGx65T560DsckZFRJ-k,4462
|
|
@@ -18,8 +18,8 @@ baudolo/restore/db/__init__.py,sha256=C4K_YAB0F9p8QhZRZIRyV2naMb54Qf_1O2cDxwwVQA
|
|
|
18
18
|
baudolo/restore/db/mariadb.py,sha256=_JEQFuF4GhTl8lKmgk2gsHYcXHcpCKrf32tigMSeTKI,2782
|
|
19
19
|
baudolo/restore/db/postgres.py,sha256=_NIlcxdpcQIUZ8SNBWfWIaH1oGIkmZy9emFMgjGznhk,1446
|
|
20
20
|
baudolo/seed/__main__.py,sha256=BnN0Ckdjr30r6yxORq-ctrdmkT0yfeRIuXnyhKSe8Us,3430
|
|
21
|
-
backup_docker_to_local-1.
|
|
22
|
-
backup_docker_to_local-1.
|
|
23
|
-
backup_docker_to_local-1.
|
|
24
|
-
backup_docker_to_local-1.
|
|
25
|
-
backup_docker_to_local-1.
|
|
21
|
+
backup_docker_to_local-1.5.0.dist-info/METADATA,sha256=yEIbwvxjC2sEdIkBCJjFVw4ESBRtYK7cbRl7DknMxWo,7200
|
|
22
|
+
backup_docker_to_local-1.5.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
23
|
+
backup_docker_to_local-1.5.0.dist-info/entry_points.txt,sha256=92f5jPSjW__9-u5gzwmWkdiHKt4ysEFCVmwMtorQCv4,147
|
|
24
|
+
backup_docker_to_local-1.5.0.dist-info/top_level.txt,sha256=y_5iNpF7EdLzqWWXIDfcTJpqijyy2hvrYgNiJXrN4r4,8
|
|
25
|
+
backup_docker_to_local-1.5.0.dist-info/RECORD,,
|
baudolo/backup/app.py
CHANGED
|
@@ -2,10 +2,12 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import pathlib
|
|
5
|
+
import sys
|
|
5
6
|
from datetime import datetime
|
|
6
7
|
|
|
7
8
|
import pandas
|
|
8
9
|
from dirval import create_stamp_file
|
|
10
|
+
from pandas.errors import EmptyDataError
|
|
9
11
|
|
|
10
12
|
from .cli import parse_args
|
|
11
13
|
from .compose import handle_docker_compose_services
|
|
@@ -96,6 +98,42 @@ def backup_mariadb_or_postgres(
|
|
|
96
98
|
return False, False
|
|
97
99
|
|
|
98
100
|
|
|
101
|
+
def _empty_databases_df() -> "pandas.DataFrame":
|
|
102
|
+
"""
|
|
103
|
+
Create an empty DataFrame with the expected schema for databases.csv.
|
|
104
|
+
|
|
105
|
+
This allows the backup to continue without DB dumps when the CSV is missing
|
|
106
|
+
or empty (pandas EmptyDataError).
|
|
107
|
+
"""
|
|
108
|
+
return pandas.DataFrame(columns=["instance", "database", "username", "password"])
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _load_databases_df(csv_path: str) -> "pandas.DataFrame":
|
|
112
|
+
"""
|
|
113
|
+
Load databases.csv robustly.
|
|
114
|
+
|
|
115
|
+
- Missing file -> warn, continue with empty df
|
|
116
|
+
- Empty file -> warn, continue with empty df
|
|
117
|
+
- Valid CSV -> return dataframe
|
|
118
|
+
"""
|
|
119
|
+
try:
|
|
120
|
+
return pandas.read_csv(csv_path, sep=";", keep_default_na=False, dtype=str)
|
|
121
|
+
except FileNotFoundError:
|
|
122
|
+
print(
|
|
123
|
+
f"WARNING: databases.csv not found: {csv_path}. Continuing without database dumps.",
|
|
124
|
+
file=sys.stderr,
|
|
125
|
+
flush=True,
|
|
126
|
+
)
|
|
127
|
+
return _empty_databases_df()
|
|
128
|
+
except EmptyDataError:
|
|
129
|
+
print(
|
|
130
|
+
f"WARNING: databases.csv exists but is empty: {csv_path}. Continuing without database dumps.",
|
|
131
|
+
file=sys.stderr,
|
|
132
|
+
flush=True,
|
|
133
|
+
)
|
|
134
|
+
return _empty_databases_df()
|
|
135
|
+
|
|
136
|
+
|
|
99
137
|
def _backup_dumps_for_volume(
|
|
100
138
|
*,
|
|
101
139
|
containers: list[str],
|
|
@@ -136,9 +174,10 @@ def main() -> int:
|
|
|
136
174
|
# IMPORTANT:
|
|
137
175
|
# - keep_default_na=False prevents empty fields from turning into NaN
|
|
138
176
|
# - dtype=str keeps all columns stable for comparisons/validation
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
177
|
+
#
|
|
178
|
+
# Robust behavior:
|
|
179
|
+
# - if the file is missing or empty, we continue without DB dumps.
|
|
180
|
+
databases_df = _load_databases_df(args.databases_csv)
|
|
142
181
|
|
|
143
182
|
print("💾 Start volume backups...", flush=True)
|
|
144
183
|
|
|
@@ -168,7 +207,8 @@ def main() -> int:
|
|
|
168
207
|
if found_db:
|
|
169
208
|
if not dumped_any:
|
|
170
209
|
print(
|
|
171
|
-
f"WARNING: dump-only-sql requested but no DB dump was produced for DB volume '{volume_name}'.
|
|
210
|
+
f"WARNING: dump-only-sql requested but no DB dump was produced for DB volume '{volume_name}'. "
|
|
211
|
+
"Falling back to file backup.",
|
|
172
212
|
flush=True,
|
|
173
213
|
)
|
|
174
214
|
# fall through to file backup below
|
|
File without changes
|
{backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{backup_docker_to_local-1.4.0.dist-info → backup_docker_to_local-1.5.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|