I’m an new users for kopia, I want to create 2 policy for one directory,
for example,
i want to create the snapshot for aaa/ hourly from 9am to 9pm, and keep the snapshot for 24hours;
in the meantime, i also want to create another snapshot for aaa/ daily at 11pm, and keep the snapshot for 7 days
So what is the solution?
Someone can correct me if I am wrong, but I believe this is only possible if you connect to two different repos simultaneously – one repo where you can set the hourly snapshot policy for aaa
and the second repo where you can set the daily snapshot policy for aaa
.
The good thing is, Kopia allows you to easily connect to multiple repos simultaneously by running multiple kopia
processes. KopiaUI makes it even easier, just right-click the desktop icon to connect to a different repo.
Note that you can use the same cloud storage account in this situation, but make sure you use different buckets, because Kopia supports one repo per bucket.
thanks, so it means double data is stored in the different two repos, right?
Yes.
Here is possibly another strategy that allows you to do something very similar to what you want but within the same repo (and thus taking advantage of deduplication). I have not tried it myself, but it may work for you.
(1) Create a Kopia policy
to backup aaa
(2) Instead of picking a Snapshot Frequency
(e.g., every 10 mins), use the Times of Day
feature to tell Kopia to backup at 9am, 10am, etc. to 9pm and also at 11pm. Note that you have to use 24-hour time format here.
(3) In Snapshot Retention
, tell Kopia to keep 14 Hourly
snapshots and 7 Daily
Snapshots
This should get you really close to what you want.
so you means just to set the --snapshot-time & rention numbers without crontab?
but when I try to set the policy as below, the snapshot for 8am-8pm can be created automatically, but the snapshot for 23:00 cannot be created automatically,
Retention:
Annual snapshots: 0 inherited from (global)
Monthly snapshots: 0 inherited from (global)
Weekly snapshots: 0 inherited from (global)
Daily snapshots: 7 inherited from (global)
Hourly snapshots: 14 (defined for this target)
Latest snapshots: 21 inherited from (global)
Files policy:
Ignore cache directories: true inherited from (global)
No ignore rules:
Read ignore rules from files: inherited from (global)
.kopiaignore
Scan one filesystem only: false inherited from (global)
Error handling policy:
Ignore file read errors: false inherited from (global)
Ignore directory read errors: false inherited from (global)
Ignore unknown types: true inherited from (global)
Scheduling policy:
Scheduled snapshots:
Snapshot times: (defined for this target)
8:00
9:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
Manual snapshot: false inherited from (global)
Uploads:
Max parallel snapshots (server/UI): 1 inherited from (global)
Max parallel file reads: - inherited from (global)
Compression disabled.
No actions defined.
Logging details (0-none, 10-maximum):
Directory snapshotted: 5 inherited from (global)
Directory ignored: 5 inherited from (global)
Entry snapshotted: 0 inherited from (global)
Entry ignored: 5 inherited from (global)
Entry cache hit: 0 inherited from (global)
Entry cache miss: 0 inherited from (global)
I do not know what you mean. You should be able to specify all the times you want to run a snapshot using --snapshot-time
Comma-separated times of day when to take snapshot (HH:mm,HH:mm,…) or ‘inherit’ to remove override