-
Notifications
You must be signed in to change notification settings - Fork 25
Config file and profiles
Issue: https://github.com/sourcefrog/conserve/issues/163
Have a toml, yaml, or json5 file that specifies what should be backed up to where.
Specify multiple "profiles", each with a source and destination.
With profiles configured then backup, diff, restore, versions, etc, all optionally take a --profile, -p NAME instead of an archive and source. (But, maybe restore should still require the destination to be specified.)
[profile.home] source = "/home/mbp" archive = "/backup/machine/home_mbp.c6" period = "10 min" # make a new backup this often; all times are parsed with humantime retain_hourly = "4 weeks" retain_daily = "12 months" # delete all but the first backup in each UTC day that is older than 12 months retain_weekly = "3 years" exclude = [ "target/debug", "target/release" ] exclude_from = [ "~/src/backup-scripts/home-exclude" ] [mirror.home_s3] source_archive = "/backup/machine/home_mbp.c6" dest_archive = "s3://bucket.example/home_mbp.c6" aws_credentials = "~/.secret/conserve-s3-credentials.json" # or maybe point to a keyring or read from env/imds [mirror.home_flash] source_archive = "/backup/machine/home_mbp.c6" dest_archive = "/volumes/conserve/home_mbp.c6" if_archive_mounted = true # silently skip if the destination does not exist
conserve config path prints the path.
conserve config add interactively configure a new profile?
set to set values
conserve run will run through all profiles (or selected profiles).
For each profile that has a period configured, look at how much time has passed since the start of the last version. If it's due for a new backup, make one.
Then, for every backup that has expiry configured, find any versions that are older, and delete them.
You can configure with --action=backup,expire,... to run only some of these.