Files
Athena-Deck/deploy/backup_applio_data.py
T
Mikei386 06cacafbad Add native Applio RVC and preserve the custom studio UI
Pin Applio 3.6.5 and verified basis assets, migrate private voice provenance, and coordinate conversion/live/training with Deck GPU leases. Prepare an inactive voice profile and a restricted studio container. Move CUDA and Torch caches out of the small temporary filesystem to prevent OmniVoice reference failures. Package app updates from the explicit allowlist in one Docker layer.
2026-10-05 10:02:07 +02:00

21 lines
1.2 KiB
Python

"""Explicit private-data archive, separate from Deck's configuration backup."""
import argparse,json,tarfile
from pathlib import Path
def main():
p=argparse.ArgumentParser();p.add_argument('state',type=Path);p.add_argument('archive',type=Path);args=p.parse_args();root=args.state.resolve()/'applio-data'
if not root.is_dir():raise SystemExit('Applio-Daten fehlen.')
if args.archive.exists():raise SystemExit('Archiv existiert bereits; wird nicht überschrieben.')
if args.archive.resolve().is_relative_to(root):raise SystemExit('Archivziel muss außerhalb der Applio-Daten liegen.')
names=('logs','datasets','jobs','settings.json','migration-manifest.json')
with tarfile.open(args.archive,'w:gz') as archive:
for name in names:
path=root/name
if path.exists():archive.add(path,arcname='applio-data/'+name,recursive=True)
for entry in (args.state.resolve()/'models').glob('*/entry.json'):
if (json.loads(entry.read_text()).get('runtime_metadata') or {}).get('architecture')=='rvc':
archive.add(entry.parent,arcname='models/'+entry.parent.name,recursive=True)
args.archive.chmod(0o600)
print('Eigene Stimmen, Trainingsstände, Datensätze und Einstellungen gesichert:',args.archive)
if __name__=='__main__':main()