How do policies work exactly when it comes to scheduling

Hi there,

I am new to kopia and so far, I like it.

But there is one thing I don’t understand: How the hell do policies work? And even more: How do intervals work?

And what does this even mean? Well, I saw the help:

      --snapshot-interval=SNAPSHOT-INTERVAL ...  
                                 Interval between snapshots

But what does that mean? Will kopia create a systemd timer or cronjob for me? A daemon is not running on my Ubuntu server, as far as I can tell.

And where is all that saved? If I do

kopia --config-file /root/.config/kopia/local.config policy set --global --snapshot-interval 1h

nothing is saved in the local.config.

My goal is to automate that process for some of my servers and I am still not sure, whether I should ansible run a few cli commands or whether I should create a config using a template.

Any scheduling related policies only apply when you use kopia GUI app. Otherwise they do nothing.

There is no CLI scheduler for any OS.

Hi there,

thank you very much for your response. That is helpful.

I got a few more questions, if you don’t mind:

  • Are there other CLI commands that don’t work without kopia UI?
  • What would you advice me to choose: Automate kopia using CLI-commands or building configs based on templates?

Thanks a lot :slight_smile:

All CLI commands work without UI… UI is just a fancy wrapper + scheduler.

Depends:) If you do not mind running UI all the time then do not bother with CLI.

Myself I prefer CLI and my own scheduler (systemd). It runs kopia snapshot create --all and kopia maintenance run --full on my preferred schedule.

Please note that you can use both CLI and UI at the same time. When I want to restore some file I start UI - much faster and easier than CLI syntax:)

For starting with kopia I would recommend UI first and then if needed/wanted starting with CLI.

All policies are stored inside the repository.

I’d personally go with CLI commands because it feels saver than messing around with undocumented repository.config and repository.config.kopia-password files.

But beware that Kopia overrides the configuration file when running kopia repo connect on a already connected repository. You might want to create a check for that in your playbook.