# Use of BR - Incremental Backup

__*Using BR*__
__*BR incremental backup*__

```
LAST_BACKUP_TS=`br validate decode --field="end-version" -s s3://backup-data/2022-01-30/ | tail -n1`

br backup full\
    --pd ${PDIP}:2379 \
    --ratelimit 128 \
    --storage "s3://backup-data/2022-01-30/incr" \
    --lastbackupts ${LAST_BACKUP_TS}
```
-------------------------------------------------------------
TiDB cluster incremental data contains data on the difference between the beginning and end snapshots of a certain time period. Incremental data is smaller than snapshot data, and is suitable for use with snapshot backups to reduce the amount of data backed up.

If you want to back up incremental data, you only need to specify the last backup timestamp —lastbackupts when backing up using br backup. You can use the validate command to get the timestamp of the last backup, for example:
LAST*BACKUP*TS=`br validate decode --field="end-version" -s s3://backup-data/2022-01-30/ | tail -n1`

Note:
Incremental backup data needs to be saved in a different path than the previous snapshot backup data.
The GC safepoint must be before lastbackupts. The default GC Lifetime of TiDB is 10 minutes, which means that the default TiDB only supports backing up incremental data within 10 minutes. If you want to back up incremental data for a longer period of time, you need to adjust the GC Lifetime settings for your TiDB cluster.

br backup full\
    —pd$ {PDIP} :2379\
    —ratelimit 128\
    —storage "s3://backup-data/2022-01-30/incr"\
    —lastbackupts $ {LAST*BACKUP*TS}

The above command backs up the incremental data between (LAST*BACKUP*TS, current PD timestamp] and DDL during that time. At the time of recover, BR restores all DDLs before recover the data.