Allow creation of machine specific configs.

This commit is contained in:
Craig
2025-04-24 16:54:51 +01:00
parent 3540d48df9
commit 677e846b24
4 changed files with 32 additions and 3 deletions

View File

@@ -146,9 +146,19 @@ def local_backup(output_dir: Path, backup_name: str, inputs: list, ignore_patter
def backup_all():
config_dir = Path(__file__).parent / "configs"
config_files = sorted(config_dir.glob("*"))
print(config_files)
# Get all JSON files except the example config
config_files = sorted([f for f in config_dir.glob("*.json") if f.name != "example-config.json"])
if not config_files:
print("No configuration files found. Please create a config file in the 'configs' directory.")
print("You can copy the example-config.json to create your own configuration:")
print("cp configs/example-config.json configs/my-backup.json")
return
print(f"Found {len(config_files)} config files: {[f.name for f in config_files]}")
for file in config_files:
print(f"\nProcessing backup configuration: {file.name}")
text = file.read_text()
config = json.loads(text)
output_dir = Path(config["outputDir"]).expanduser().resolve()