Snapshot on drive mount

No.

Does not matter how you connect (GUI or CLI) - it creates the same config files. Myself if I have more than one repo I connect from CLI as it allows me to specify kopia.config file name. So I can have always the same name in scripts. But this is purely for cosmetic reasons only.

I tried it with --rclone-exe=“usr/local/bin/rclone” and now it tells me unknown long flag ‘–rclone-exe’

I stopped using kopia/rclone as it was not reliable enough for me so I can only refer to my past notes and patchy memory:)

Possible that rclone flags only apply to kopia connect. As rclone binary location and flags are stored in kopia.conf file.

PS. At least for testing give your shell (bash, sh or whatever you are using) full disk access in macOS System Settings → Privacy & Security. This is another challenge when working with macOS. You either give your stuff all access or you have to package and sign it later.

The rclone exe path is explicitly defined in the repository.config files.

So why doesn’t the CLI work with my configs?

I can not see your screen. Post all details (redact sensitive info).

Does simple command like:

$ kopia --config-file="/Users/myuser/Library/Application Support/kopia/repository-myconfig.config" snapshot list

work?

FYI. I have just tested it with my setup and all works for repo connected from GUI and using rclone.

The problem and its solution are incredibly dumb but I’m posting here in case someone has this problem:

The GUI allows you to specify the path as usr/local/bin/rclone without the initial / and it will work and save a config file without the initial /, BUT
the CLI requires the initial / or you will get an error.
If you want to use your GUI config file with the CLI, you need to write the path as
/usr/local/bin/rclone
when creating your repository

The GUI should be modified so that it doesn’t let users input a path without an initial / when creating a repository. Or it should append one when creating the config file. Otherwise the config files it produces will not work with the CLI.

Ok here’s how I achieved snapshot on mount for my cryptomator volume on Mac OS:

  1. Using Lingon (or manually) create a launchd plist, I named mine onMount
    Make it point to a script, I set mine for the default zsh shell and named it .createSnapshot (the prefixed . just makes it hidden in finder, change as preferred)
  2. Save this script ON the volume you want to be backed up when mounted
  3. Under advanced in Lingon, set your launchd agent to run on volume mount. This will run when any volume is mounted, which is why we saved the script to the external volume we want to back up. When any other volume is mounted (e.g. a thumb drive), the launch agent simply won’t find the script and your commands won’t run.
  4. In the script, you want something like:
    kopia snapshot create “/path/to/source” --config-file=“/path/to/config”
  5. To add notifications, get terminal-notifier
    brew install terminal-notifier
    Edit your script to something like this:
    kopia snapshot create “/path/to/source” --config-file=“/path/to/config” && terminal-notifier -title “Kopia CLI” -message “Snapshot created”
  6. For extra credit, you can change the icon of terminal notifier to show the kopia icon, see here: Small terminal icon in title when using -appIcon option ¡ Issue #131 ¡ julienXX/terminal-notifier ¡ GitHub
1 Like