To fulfill the 3-2-1 rule’s requirement for an offsite backup, a repository has been pointed to removable storage media (such as USB hard drives or RDX disks). The action of swapping to a new medium causes Veeam Backup & Replication jobs to fail because the job cannot find a file.
By default, Veeam Backup & Replication assumes that if recent files are missing, the job should fail. This way, the job provides a notification that something is wrong instead of taking any action.
For an introduction to Veeam Backup & Replication’s options for rotated media, consult the user guide. The following notes assume the option for rotated media is enabled in the repository advanced settings.
Retention Options on Windows-type Repositories
There are three options:
- Default backup job behavior;
- Default backup copy job behavior;
- Deleting files when disks are rotated.
Backup jobs will always create active full backups immediately after disks are rotated. This option requires that each storage medium has sufficient disk space for at least two full backup files.
With backup copy jobs, when a new disk is detected, the job will only create a full backup if there are no valid backups on the disk for that job. If an existing backup set is detected, the backup copy job will create an incremental backup file that contains the difference between the current restore point and the most recent previous restore point on that disk. As a result, if disks are re-used frequently, the incremental backup files will be similar in size to increments on non-rotated media; if a disk contains very old restore points, the first new incremental backup copy may be almost as large as a full backup.
With both job types, Veeam Backup & Replication tracks restore points stored on all disks that have been used with the job. If outdated restore points are stored on the current disk, they are only deleted at the end of the current job session.
For example, consider a job that creates two restore points per day, with disks swapped once per day, a total of three disks, and retention policy set to 6 restore points.
- A forward incremental backup job creates a full backup file and an increment on each of the three disks over the first three days. On the fourth day, the first disk is re-used. A new full backup file is created. There are now 7 points across all disks, so retention policy is met, but the initial full backup cannot be deleted because an incremental file is dependent on it. After another restore point is created, the older two files on disk 1 are deleted by retention policy.
- A backup copy job also creates a full backup file and an incremental file on each of the three disks over the first three days. On the fourth day, the first disk is re-used. A new incremental backup file is created, and the oldest incremental file is merged into the full backup file.
If a disk does not contain enough space for a new backup file, the job will fail instead of deleting old files. This can be avoided by deleting old files as soon as the disks are swapped. This can be done manually, via pre-job script, or with the registry setting described below.
Retention on All Other Repositories
By default, repositories configured for rotated media do not delete any backup files when disks are swapped. If a disk containing a previous backup is to be re-used, but lacks sufficient available space for new backup files, the old files must be deleted manually, or by a pre-job script.
Retention policy is enforced, but only on the current backup chain. For example, consider a backup copy job that creates restore points every hour, with disks swapped once per day, and retention policy set to 6 restore points. Once there are 7 restore points on the current disk (a full backup file and 6 incremental backup files), the oldest increment is merged with the full backup file so that there are 6 restore points on disk. The disk is swapped out for a new one, and the process repeats. When the first disk is re-used, the 6 backup files still on the disk are ignored. A new full backup file is created, and a new chain of incremental files. At the end of the day, there are 12 restore points on disk, with only the most recent 6 visible in the Veeam Backup & Replication console.
An alternative behavior is available as a registry setting (below).
Deleting Files When Disks are Rotated
When this registry setting is enabled (set to 3 or 5), any repository, regardless of rotated media setting, will maintain retention normally until the job detects that previously-available files are missing.
Create this value on the Veeam Backup and Replication server:
HKLM\Software\Veeam\Veeam Backup and Replication
Set to 3 to make the job delete the entire contents of the backup job’s folder only.
Set to 5 to make the job delete the entire contents of the root backup repository folder, potentially deleting any files belonging to other jobs. Note that if the backup repository points at the volumes root folder, the entire volume's contents are erased.
The Veeam Backup Service must be restarted after creating this registry value. Make sure no jobs or restores are running before restarting this service.