--- title: "Specifying Long-Term Retention Policy" description: "You can configure long-term retention policy to keep weekly, monthly or yearly full backups. After you configure a long-term retention policy, Veeam Agent will automatically enable long-term retention for the backup job." canonical: "https://helpcenter.veeam.com/docs/agentformac/userguide/backup_job_cmd_gfs_set.html" breadcrumb: "User Guide > Performing Backup > Creating Backup Jobs > Creating Backup Job in Command Line Interface > Configuring Long-Term Retention Policy > Specifying Long-Term Retention Policy" dateModified: "2026-10-23" --- # Specifying Long-Term Retention Policy You can configure long-term retention policy to keep [weekly](#week), [monthly](#month) or [yearly](#year) full backups. After you configure a long-term retention policy, Veeam Agent will automatically enable long-term retention for the backup job. ## Configuring Long-Term Retention Policy to Keep Weekly Full Backups {#week} To configure long-term retention policy to keep weekly full backups, use the following command: ``` veeamconfig gfs set --jobid weekly --on --keep ``` or ``` veeamconfig gfs set --jobname weekly --on --keep ``` where: - `` — ID of the backup job for which you want to configure the long-term retention policy. You should look up the job ID in advance, before configuring the schedule, for example, with the `veeamconfig job list` command. To learn more, see [Viewing List of Backup Jobs](backup_job_list.md). - `` — name of the backup job for which you want to configure the long-term retention policy. - `` — week day when Veeam Agent must assign a weekly GFS flag to a full restore point — for example, `Tue` or `Tuesday`. - `` — number of weeks to keep the weekly GFS flag on the full restore point. For example: ``` user@wrk01:~$ veeamconfig gfs set --jobid 4849a3ae-1935-4969-98a3-d8acd2f6c73f weekly --on Saturday --keep 1 ``` ## Configuring Long-Term Retention Policy to Keep Monthly Full Backups {#month} To configure long-term retention policy to keep monthly full backups, use the following command: ``` veeamconfig gfs set --jobid monthly --on --keep ``` or ``` veeamconfig gfs set --jobname monthly --on --keep ``` where: - `` — ID of the backup job for which you want to configure the long-term retention policy. You should look up the job ID in advance, before configuring the schedule, for example, with the `veeamconfig job list` command. To learn more, see [Viewing List of Backup Jobs](backup_job_list.md). - `` — name of the backup job for which you want to configure the long-term retention policy. - `` — number of the week when Veeam Agent must assign a monthly GFS flag to a full restore point. Possible values: `First`, `Second`, `Third`, `Fourth` or `Last`. - `` — number of months to keep the monthly GFS flag on the full restore point. For example: ``` user@wrk01:~$ veeamconfig gfs set --jobid 4849a3ae-1935-4969-98a3-d8acd2f6c73f monthly --on Second --keep 6 ``` ## Configuring Long-Term Retention Policy to Keep Yearly Full Backups {#year} To configure long-term retention policy to keep yearly full backups, use the following command: ``` veeamconfig gfs set --jobid yearly --on --keep ``` or ``` veeamconfig gfs set --jobname yearly --on --keep ``` where: - `` — ID of the backup job for which you want to configure the long-term retention policy. You should look up the job ID in advance, before configuring the schedule, for example, with the `veeamconfig job list` command. To learn more, see [Viewing List of Backup Jobs](backup_job_list.md). - `` — name of the backup job for which you want to configure the long-term retention policy. - `` — month when Veeam Agent must assign a yearly GFS flag to a full restore point — for example, `Jan` or `January`. - `` — number of years to keep the yearly GFS flag on the full restore point. For example: ``` user@wrk01:~$ veeamconfig gfs set --jobid 4849a3ae-1935-4969-98a3-d8acd2f6c73f yearly --on January --keep 3 ```