8.7 Backup copies (3-2-1)
A copy job copies snapshots from one repository into another, for example from a NAS to S3, and keeps its own retention there. This implements the 3-2-1 rule: three copies of the data, on two different media, one of them off-site.
How it works
The job runs on the server, not on an agent.
Missing data is re-encrypted with the target's key and uploaded. Source and target therefore each have their own passphrase. Only what the target lacks is transferred (deduplicated against what the target already holds); snapshots that are already there are skipped. A snapshot counts as present when tree and time match.
Only snapshots that this server created itself and that are in the catalog are copied. Foreign snapshots are not taken over.
The run log summarizes: "N snapshot(s) selected, N already in the target, N copied". If retention in the target fails afterwards, the run ends with a warning.
If the target is a repository with Per-machine index, the machines that created the snapshots get access to the copied data.
If the target is a drive of a rotation set, the job writes to the attached disk; if none is attached, the run fails (see section 8.6 Rotated drives and storage quotas).
Creating a copy job
Open Jobs and create a new job, choosing the type Copy. Alternatively choose Copy⦠in the More⦠menu of the repository card, or the Copy button in the details ("Copy snapshots into another repository").
Choose From repository (source) and To repository (target). The name becomes "Copy source β target" automatically. The target list adds notes such as "lock 30 d" for repositories with Object Lock.
Under Which snapshots set filters if needed. Without filters, every backup snapshot of the source is copied.
In the Schedule section choose when the job runs. A common choice is After another job with the backup job under After job (see chapter 07 Schedules and Plans).
Set Retention in the target (see section 8.4 Retention) and save.
Filters and options
Option | Effect | Default |
|---|---|---|
From repository | Source from which snapshots are read. | β |
To repository | Target that is written to. Must be a different repository than the source. | β |
Only these backup jobs | Copies only snapshots of the ticked backup jobs of the source. | all |
Only these agents | Copies only snapshots of the ticked machines. | all |
Tags | Copies only snapshots that carry all listed tags (comma separated, for example | empty |
Only younger than (days) | Copies only snapshots younger than this many days. Empty or 0: all. | all |
Also copy server configuration backups | Includes the server's configuration backups (snapshots with the system tag). Without the tick they are never copied. | off |
Retention in the target | Rules as in section 8.4 Retention. They apply in the target per source job and only to the copies this copy job made. Presets as for the backup job. | β |
Enabled (scheduled runs) | Turns the schedule on or off. | on |
The filters combine: a snapshot is copied if it belongs to one of the chosen jobs and one of the chosen agents, carries all tags and is young enough. The age filter only acts when copying; for retention in the target, all copied snapshots count.
Retention of the copies
The target has its own retention, independent of the source. Typically shorter periods locally and longer ones off-site, for example GFS 14/8/24/5 in the target. It is applied
at the end of every copy run (log: "retention in the target: N snapshot(s) forgotten") and
by the maintenance job of the target repository (see section 8.8 Maintenance, checks and restore tests).
If the target is an S3 repository with Object Lock or a hardened repository, the retention of the copies must be longer than the lock; Last alone is refused (see section 8.4 Retention). Such a target also works as a truly immutable copy: even if the source and the server are compromised, the locked data stays.
Automatic 3-2-1 copies
Instead of creating a copy job per backup job, the automation settings (3-2-1 copies, see chapter 12 Automation and Deployment) can create one managed copy job per backup job:
Option | Effect | Default |
|---|---|---|
Copy to | The secondary repository. | none |
Copy timing | After each successful run of the backup job, or on a schedule. | after the backup |
Copy schedule | Applies only if copying is not done after the backup; must be time-based. | daily 07:00 |
Retention of the copies | Its own rules, or those of the backup job. | those of the backup job |
Exclusions | Backup jobs that are excluded. | none |
If a backup job already has a copy job of its own, that one wins; automation then does not create a second.
Example through the API
api -X POST $S/jobs -d '{"name":"offsite","kind":"copy","repository_id":"<NAS repo>",
"target_repository_id":"<S3 repo>","spec":{"job_ids":["<backup job>"]},
"schedule":{"type":"after","job_id":"<backup job>"},
"retention":{"keep_daily":14,"keep_monthly":12}}'
The schedule after starts the copy job after a successful run of the backup job (status success or warning); with "on":"always" also after failures. In the API the filters are job_ids, agent_ids, tags, max_age_days and include_system. Here api stands for a curl call with a login to the server and $S for the server's API address (see chapter 12 Automation and Deployment).