# GFS Retention Policy Settings in CLI

## Configuring GFS Retention Policy Settings in CLI

To enable GFS retention policy and configure one of the available GFS keeping periods for a backup plan, use the following parameters with the add and/or edit plan commands:

#### Yearly Keeping Period

```bash
-gfsY (-gfsYearly). This parameter enables GFS policy and sets yearly GFS keeping period. 

Parameter syntax: -gfsY N or -gfsYearly N, where N is the number of years the yearly backup will be kept. N value must be an integer and >0. Maximum value for N: **1000**.

This parameter can be used along with -gfsW and -gfsM parameters.

Example: -gfsY 2. Note: this parameter cannot be applied in plans created in the legacy backup format
```

#### Monthly Keeping Period

```bash
-gfsM (-gfsMonthly). This parameter enables GFS policy and sets monthly GFS keeping period. 

Parameter syntax: -gfsM or gfsMonthly N, where N is the number of months the monthly backup will be kept. N value must be an integer and >0. Maximum value for N: **100000*

This parameter can be used along with -gfsW and -gfsY parameters.

Example: -gfsM 4. Note: this parameter cannot be applied in plans created in the legacy backup format
```

#### Weekly Keeping Period

```bash
-gfsW (-gfsWeekly). This parameter enables GFS policy and sets a weekly keeping period.

Parameter syntax: -gfsW or gfsWeekly N, where N is the number of weeks the weekly backup will be kept. N value must be an integer and >0. Maximum value for N: **100000*

This parameter can be used along with -gfsM and -gfsY parameters.

Example: -gfsW 3. Note: this parameter cannot be applied in plans created in the legacy backup format
```

#### Disabling GFS

To disable the specified GFS type for existing backup plans, use the following parameters with the edit plan commands:

```bash
-gfsWDisable (-gfsWeeklyDisable) disables the weekly GFS type, if enabled. The parameter has no arguments
-gfsMDisable (-gfsMonthlyDisable) disables the monthly GFS type, if enabled. The parameter has no arguments
-gfsYDisable (-gfsYearlyDisable) disables the yearly GFS type, if enabled. The parameter has no arguments
```

### CLI Examples

#### Create New Backup Plan with Enabled GFS Keeping Periods

`cbb.exe addbackupibbplan -n GFS -a MyS3 -v {volumeIdList} -weekdayForceFull 4 -nbf -gfsWeekly 4 -gfsMonthly 2 -gfsYearly 1 -notification errorOnly`

This command creates a new backup plan in the format that supports the GFS policy, enables the GFS policy, and specifies the following keeping periods for GFS policy: weekly restore points are kept for 4 weeks, monthly restore points are kept for 2 months, yearly restore points are kept for 1 year.

#### Edit the Existing Plan and Enable Weekly and Monthly GFS Keeping Periods

`cbb.exe editBackupPlan -n "CLI GFS" -gfsM 20 -gfsWeekly 4`

This command enables the GFS settings for the existing backup plan named **CLI GFS**: enables GFS policy with weekly keeping period that will be kept for **4** weeks and monthly keeping period that will be kept for **20** months.

#### Edit the Existing Plan and Disable GFS Policy

`cbb.exe editBackupPlan -n "CLI GFS" -gfsWDisable -gfsMDisable -gfsYDisable`

This command disables all GFS settings for the existing backup plan **CLI GFS**

Note that all existing weekly, monthly and yearly backups will be kept according to previously specified GFS settings.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://system-development-services.gitbook.io/truesecure-guide/backup-format-overview/about-gfs/configure-gfs-policy/gfs-retention-policy-settings-in-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
