cli-backup 0.2.0__py3-none-any.whl → 0.2.1__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.
cli_backup/scheduled.py CHANGED
@@ -668,6 +668,8 @@ def main(argv=None) -> int:
668
668
  target = args.database or (names[0] if len(names) == 1 else selected)
669
669
  if target not in names:
670
670
  raise ValueError('restore target database is not configured')
671
+ if target != selected:
672
+ raise ValueError('restoring to a different database name is not supported safely')
671
673
  prompt = f'Restore {source_project}/{selected} into {settings.project}/{target}? Type yes: '
672
674
  if not sys.stdin.isatty() or input(prompt) != 'yes':
673
675
  raise ValueError('restore not confirmed')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-backup
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Host backup CLI for database snapshots and directory archives
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://github.com/XakkiDev/cli-backup
@@ -76,10 +76,10 @@ make cli-backup@verify path=daily where=local file=2026-01-01.example.sql.gz
76
76
 
77
77
  Additional targets `cli-backup@restore-test` and `cli-backup@restore` exist for MariaDB/MySQL. A live restore is destructive, requires an explicit file and interactive confirmation, and must target the correct stopped-writer environment. A restore rehearsal creates a disposable isolated container and should run only with appropriate authorization. For an unavailable source container, set `CLI_BACKUP_TEST_MYSQL_IMAGE` to an appropriate disposable test image before a rehearsal. Use `db=<name>` to filter when needed. Source-independent `list` and `verify` work with a stopped database container.
78
78
 
79
- To restore a backup from another project into this project's selected MariaDB/MySQL database, explicitly specify the source project and database. Stop writers and run interactively only with authorization; the confirmation names both source and destination. The destination database must already exist. This example reads from S3 without a persistent intermediary dump file:
79
+ To restore a backup from another project into this project's selected MariaDB/MySQL database, explicitly specify the source project and database. Source and destination database names must match: SQL dumps can contain database-qualified statements. Stop writers and run interactively only with authorization; the confirmation names both projects and the database. The destination database must already exist. This example reads from S3 without a persistent intermediary dump file:
80
80
 
81
81
  ```sh
82
- make cli-backup@restore where=s3 path=daily file=2026-01-01.production.sql.gz source_project=production source_db=production db=development
82
+ make cli-backup@restore where=s3 path=daily file=2026-01-01.app.sql.gz source_project=production source_db=app db=app
83
83
  ```
84
84
 
85
85
  ### Storage and schedule
@@ -6,11 +6,11 @@ cli_backup/files.py,sha256=68IPkK_osehcubXWAk1P7inRQDQ8tNh0X5CSNllLwDo,9573
6
6
  cli_backup/mysql.py,sha256=03zk-clPJJwG7hAGpKosioLpHVuAU6Op-OkmNC-xTdo,5197
7
7
  cli_backup/redis_backup.py,sha256=YNRgHytK9jHn7CXMzWUSEvwrOdRZ39Vu6H-qRcKJY8A,1090
8
8
  cli_backup/rehearsal.py,sha256=My0DWB4QL9DaI2hJwZpfv4o-deTMMvgPKwUV73Gw5M8,4093
9
- cli_backup/scheduled.py,sha256=880-CJSOtCuAZpmxjVX6uy8_qYMws-VtiPh7JMLzmkA,34761
9
+ cli_backup/scheduled.py,sha256=583sLnDZmRSwnG2_EbskAvAGngmqx6c9xJs1COPMNIs,34903
10
10
  cli_backup/storage.py,sha256=1EaPyBa5evUtVaWCcLDQr7iOkPeYzaEFYO6jFOi1p38,16534
11
- cli_backup-0.2.0.dist-info/licenses/LICENSE,sha256=LT_FggPDXG8pHihapLDPf5IkZoAXBYdF28hrxxf7sCI,1080
12
- cli_backup-0.2.0.dist-info/METADATA,sha256=fhNtCaV4ZnIYoxRcJrdRdmF7exlcJZEcPZcifPTAY2Q,10365
13
- cli_backup-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
14
- cli_backup-0.2.0.dist-info/entry_points.txt,sha256=IA3yRKrINolVcMFD4_8RB6crrNBWaO1GbCvQ2Pni1Ig,51
15
- cli_backup-0.2.0.dist-info/top_level.txt,sha256=e45rnGwSfR33PilMDehreTSxQv4vO30aPPO5AS3U-SY,11
16
- cli_backup-0.2.0.dist-info/RECORD,,
11
+ cli_backup-0.2.1.dist-info/licenses/LICENSE,sha256=LT_FggPDXG8pHihapLDPf5IkZoAXBYdF28hrxxf7sCI,1080
12
+ cli_backup-0.2.1.dist-info/METADATA,sha256=r2Rw5909u7L1ULZ0EZqBHarHe43r7XfUIN2LwqBacKI,10449
13
+ cli_backup-0.2.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
14
+ cli_backup-0.2.1.dist-info/entry_points.txt,sha256=IA3yRKrINolVcMFD4_8RB6crrNBWaO1GbCvQ2Pni1Ig,51
15
+ cli_backup-0.2.1.dist-info/top_level.txt,sha256=e45rnGwSfR33PilMDehreTSxQv4vO30aPPO5AS3U-SY,11
16
+ cli_backup-0.2.1.dist-info/RECORD,,