# Configuring retention policy with XtraBackup in pgBackRest style

**URL:** <https://forums.percona.com/t/configuring-retention-policy-with-xtrabackup-in-pgbackrest-style/27513>\
**Category:** Percona XtraBackup\
**Created:** [January 1, 2024, 5:36pm UTC](https://forums.percona.com/t/configuring-retention-policy-with-xtrabackup-in-pgbackrest-style/27513 "2024-01-01T17:36:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunoprietog](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@brunoprietog](https://forums.percona.com/u/brunoprietog)\
**Post date:** [January 1, 2024, 5:36pm UTC](https://forums.percona.com/t/configuring-retention-policy-with-xtrabackup-in-pgbackrest-style/27513/1 "2024-01-01T17:36:17Z")

</div>

Hey!

I’m configuring my Percona MySQL database backups and I want to set up a backup policy.

Doing this with pgBackRest is very simple because there’s the concept of a repository. Within the repository I can configure the retention policy.

Also, every time I do full and incremental backups I don’t have to worry about creating new folders.

And actually, what I’m interested in is that all these backups stay in S3.

Is there any way to achieve this with XtraBackup?

I feel bad having to make a custom script for this. Coming from pgBackRest it seems strange not to have something like this in XtraBackup in a more direct way.

Thanks!

---

<div class="post-metadata">

**Author:** ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)\
**Post date:** [January 5, 2024, 3:10am UTC](https://forums.percona.com/t/configuring-retention-policy-with-xtrabackup-in-pgbackrest-style/27513/2 "2024-01-05T03:10:00Z")

</div>

Hi Bruno,

Unfortunately, it’s not possible, and you will have to either script it yourself or find a suitable project to base off of.

There was an interesting project for this, but I see it’s mostly abandoned now (last commit 5 yrs ago):

> **[GitHub - dotmanila/pyxbackup: XtraBackup wrapper/manager in Python](https://github.com/dotmanila/pyxbackup)**
>
> XtraBackup wrapper/manager in Python. Contribute to dotmanila/pyxbackup development by creating an account on GitHub.

However, it might be worth a shot for you to try it out, or see if you can fork and modify it to fit your needs.
