cupcakearmy / autorestic

Config driven, easy backup cli for restic.
https://autorestic.vercel.app/
Apache License 2.0
1.34k stars 72 forks source link

Cron per backend #216

Open N-Schaef opened 2 years ago

N-Schaef commented 2 years ago

I could not find anything in the docs. Is it currently possible to have different crons per backend location?

For example:

locations:
  data:
    from: /mnt/data
    to:
      - local
      - remote

And perform the local backup daily and the remote backup weekly?

I know I could use two locations for that, but this seems more like a workaround

cupcakearmy commented 2 years ago

That is not an option rn

cupcakearmy commented 2 years ago

What you could do rn is use the extra field and yaml anchors to achieve a similar behavior. https://autorestic.vercel.app/config#aliases

version: 2

extras:
  data: &foo
    from: /mnt/data
    # ...

locations:
  data-local:
    <<: *foo
    to: local
    cron: '0 0 0 0 0'

  data-remote:
    <<: *remote
    to: local
    cron: '0 0 0 1 0'
gruentee commented 4 months ago

@cupcakearmy Thanks for the hint, I tried to solve the same problem. Still I'm a bit confused: Do I understand correctly there has to be another YAML anchor named remote ? Otherwise your snippet wouldn't work, right? Also I don't understand to has the same value for both locations - shouldn't it be local and remote or am I missing something here?