Store Beat Saber backups in adjacent repo

This commit is contained in:
pleb
2026-06-28 14:32:10 -07:00
parent 7639fb7270
commit 158bc23298
2 changed files with 10 additions and 9 deletions
+7 -6
View File
@@ -44,8 +44,8 @@ Install assets are currently expected to already exist locally, usually under:
## Beat Saber Data Backups ## Beat Saber Data Backups
`backup-userdata` copies the mounted Windows `UserData` folder and Beat Saber `backup-userdata` copies the mounted Windows `UserData` folder and Beat Saber
Windows app data into this repo. With the Windows mount at `~/Windows`, the Windows app data into the adjacent `../backups` repo. With the Windows mount at
helper infers Beat Saber's Windows app data as: `~/Windows`, the helper infers Beat Saber's Windows app data as:
```text ```text
/home/pleb/Windows/Users/pleb/AppData/LocalLow/Hyperbolic Magnetism/Beat Saber /home/pleb/Windows/Users/pleb/AppData/LocalLow/Hyperbolic Magnetism/Beat Saber
@@ -60,12 +60,13 @@ PYTHONPATH=src python -m plugin_helper \
--instance 1.44.1 --instance 1.44.1
``` ```
By default the repo receives plain copied files under `backups/beat-saber/UserData` By default the backup repo receives plain copied files under
and `backups/beat-saber/AppData`, plus `backups/beat-saber/backup-descriptor.json` `../backups/beat-saber/UserData` and `../backups/beat-saber/AppData`, plus
describing the source paths from the latest backup run. Use `../backups/beat-saber/backup-descriptor.json` describing the source paths from
the latest backup run. Use
`--appdata-path <path>` if the Windows profile path ever differs, `--no-appdata` `--appdata-path <path>` if the Windows profile path ever differs, `--no-appdata`
for a `UserData`-only sync, or `--backup-root <path>` to choose a different for a `UserData`-only sync, or `--backup-root <path>` to choose a different
repo-local destination. destination.
The backup intentionally omits bulky/generated data: The backup intentionally omits bulky/generated data:
+3 -3
View File
@@ -238,11 +238,11 @@ def build_parser() -> argparse.ArgumentParser:
backup = subcommands.add_parser( backup = subcommands.add_parser(
"backup-userdata", "backup-userdata",
help="Copy UserData and Windows AppData into this repo", help="Copy UserData and Windows AppData into the adjacent backups repo",
parents=[_common_parent()], parents=[_common_parent()],
) )
backup.add_argument("--instance", required=True) backup.add_argument("--instance", required=True)
backup.add_argument("--backup-root", default="backups/beat-saber", help="Repo-local backup directory") backup.add_argument("--backup-root", default="../backups/beat-saber", help="Backup directory")
backup.add_argument("--appdata-path", help="Override Beat Saber Windows AppData path") backup.add_argument("--appdata-path", help="Override Beat Saber Windows AppData path")
backup.add_argument("--no-appdata", action="store_true", help="Only copy UserData") backup.add_argument("--no-appdata", action="store_true", help="Only copy UserData")
@@ -560,7 +560,7 @@ def run(argv: list[str] | None = None) -> int:
root = repo_root() root = repo_root()
backup_root = Path(args.backup_root).expanduser() backup_root = Path(args.backup_root).expanduser()
if not backup_root.is_absolute(): if not backup_root.is_absolute():
backup_root = root / backup_root backup_root = (root / backup_root).resolve()
result = sync_windows_data_repo( result = sync_windows_data_repo(
instance=args.instance, instance=args.instance,
instance_path=instance.path, instance_path=instance.path,