Multiple directories

Is there a way to specify multiple directories in a snapshot source? What I’m trying to do is backup a path like /home/*/Maildir. I tried using a glob but that doesn’t seem to work. Also tried listing all the individual directories like “kopia snapshot create /home/foo/Maildir /home/bar/Maildir” but that didn’t work either. Is this possible?

Currently it’s not possible a snapshot with multiple roots. The closest is probably some form of ignore rules that excludes everything except maildir.

How many of these maildirs do you need to snapshot?

I have less than 10 Maildirs that would be snapshotted. I’ll play around with ignore rules.

I’m moving things over from duplicity, which supports --include and --exclude syntax as well as globbing. You can combine includes and excludes to be very specific about what gets backed up.

I have some other non-Maildir dirs that need to be snapshotted at the same time, so having a script that gathers all the dirs and runs kopia snapshot create for each one would work. Not sure if there’s a better way?

Currently there is not a better way and because of how Kopia identifies snapshots and policies (by their root path) that would be quite hard to do.

I suggest just snapshotting each maildir independently.

I have to say that ‘THIS’ caught me out as well. The documentation doesn’t make it clear enough that each snapshot only relates to a single root source directory.

I don’t mean this as a criticism. Just that when I saw the ability to have a policy of ‘exclusions’ I naively expected a policy of ‘inclusions’ as well.

I currently have 3 source roots: /data, /home, /app. There are multiple sub directories in each that I want and also multiple sub directories that I don’t need to save. They are roughly split 50:50. Under the current method of working I would need 3 snapshots and set ignore policies.

Whilst I agree that this provides a LOT of flexibility it doesn’t make for an easy implementation or maintenance.

You can always set policy at a parent directory and it will be inherited by children. If that does not work for some reason you can also define policy for user@host (applies to all paths on the host snapshotted by the user) or @host level, which applies to snapshots done by any user on the specified host.

Plus of course you can set a global policy that apply to all users/hosts/paths

@jkowalski I think it is a matter of changing my mindset on how I thought snapshots worked. I just need to let it sink in. Thanks for your response.

I just installed the app after quite long and I see this is still not possible (checking in KopiaUI). Does it really not come across a basic feature for a backup app?

If not in GUI directly then there could have been a way to set that in an include or config files.

1 Like