# Help configuring postgres operator backup section of cr.yaml

**URL:** https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947
**Category:** Percona Operator for PostgreSQL
**Created:** [March 25, 2023, 6:09pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947 "2023-03-25T18:09:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Michael\_Caldwell](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_caldwell/32/9857_2.png) [@Michael\_Caldwell](https://forums.percona.com/u/Michael_Caldwell)
#### Post date: [March 25, 2023, 6:09pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/1 "2023-03-25T18:09:15Z")

</div>

Hello,I am having some issues configuring backups for the postgres operator in cr.yaml, pgo-version 1.3.0. Below is my configuration along with logs from the job pod. I am using

My first question is why is the backup trying to run using s3 when I have local specified in the schedule? I have noticed if I comment out the s3 configuration, then it only runs a local backup as expected. Is this by design?

Second, it doesn’t seem like the bucket is being picked up in the configuration when I specify s3 or local in the schedule. I know it is seeing the configuration because if I change the type to gcs for example, the error log mentions it is missing a gcs bucket rather than s3.  
Thanks in advance for your help.

**Config:**

```auto
storages:
new-s3:
    type: s3
    bucket: s3://BUCKET/
    region: us-west-2
    endpointUrl: s3.amazonaws.com
    verifyTLS: false
    uriStyle: path
schedule:
  - name: "testing-backup"
    schedule: "*/3 * * * *"
    keep: 2
    type: full
    storage: local

```

**Error Logs:**  
time=“2023-03-25T17:57:03Z” level=info msg=“crunchy-pgbackrest starts”  
time=“2023-03-25T17:57:03Z” level=info msg=“debug flag set to false”  
time=“2023-03-25T17:57:03Z” level=info msg=“backrest backup command requested”  
time=“2023-03-25T17:57:03Z” level=info msg=“backrest command will be executed for both local and s3 storage”  
time=“2023-03-25T17:57:03Z” level=info msg=“command to execute is [pgbackrest backup --stanza=db --type=full --repo1-retention-full=2 --db-host=10.128.2.56 --db-path=/pgdata/dev-eng-pg-cluster-repl3 ; pgbackrest backup --stanza=db --type=full --repo1-retention-full=2 --db-host=10.128.2.56 --db-path=/pgdata/dev-eng-pg-cluster-repl3 --repo1-type=s3 --no-repo1-s3-verify-tls]”  
time=“2023-03-25T17:57:17Z” level=info msg=“output=”  
time=“2023-03-25T17:57:17Z” level=info msg=“stderr=[ERROR: [037]: backup command requires option: repo1-s3-bucket\n]”  
time=“2023-03-25T17:57:17Z” level=fatal msg=“command terminated with exit code 37”

---

<div class="post-metadata">

### Author: ![Sergey\_Zhuravlev](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_zhuravlev/32/6410_2.png) [@Sergey\_Zhuravlev](https://forums.percona.com/u/Sergey_Zhuravlev)
#### Post date: [March 27, 2023, 2:14pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/2 "2023-03-27T14:14:46Z")

</div>

Hi!  
I needed the backup to be done only locally on xxx–backrest-shared-repo-xxx only.  
This has been achieved.)  
Do you want it?

---

<div class="post-metadata">

### Author: ![Michael\_Caldwell](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_caldwell/32/9857_2.png) [@Michael\_Caldwell](https://forums.percona.com/u/Michael_Caldwell)
#### Post date: [March 27, 2023, 2:19pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/3 "2023-03-27T14:19:57Z")

</div>

Thank for the reply. I actually have it backing up locally just fine as long as I comment out the storages section, but I was wondering why I need to comment out that section if the schedule section specifies “local”.  
Ultimately, I want to use s3 but for some reason it doesn’t pick up the bucket configuration in cr.yaml.

---

<div class="post-metadata">

### Author: ![Sergey\_Zhuravlev](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_zhuravlev/32/6410_2.png) [@Sergey\_Zhuravlev](https://forums.percona.com/u/Sergey_Zhuravlev)
#### Post date: [March 27, 2023, 2:43pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/4 "2023-03-27T14:43:16Z")

</div>

I would say this: when configuring a PGO backup, there are certain non-obviousness)))

However, it is possible to achieve that it works as you need.

---

<div class="post-metadata">

### Author: ![Michael\_Caldwell](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_caldwell/32/9857_2.png) [@Michael\_Caldwell](https://forums.percona.com/u/Michael_Caldwell)
#### Post date: [March 27, 2023, 5:07pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/5 "2023-03-27T17:07:27Z")

</div>

Hopefully,  
I have been following the instructions here [Backup and restore - Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/backups.html) to set it up but it doesn’t seem to create the configmap correctly. It looks like you have to configure the configmap for your backup manually, so I am trying to do that now.

---

<div class="post-metadata">

### Author: ![Michael\_Caldwell](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_caldwell/32/9857_2.png) [@Michael\_Caldwell](https://forums.percona.com/u/Michael_Caldwell)
#### Post date: [March 27, 2023, 7:03pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/6 "2023-03-27T19:03:06Z")

</div>

Can anyone verify they actually were able to get s3 backups working using these instructions? Spent a significant amount of time trying to figure these out and trying to determine if it is worth going any furthur.  
Thanks…

> **[Backup and restore - Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/backups.html#configuring-the-s3-compatible-backup-storage)**
>
> Documentation

---

<div class="post-metadata">

### Author: ![Ivan\_Pylypenko](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_pylypenko/32/2452_2.png) [@Ivan\_Pylypenko](https://forums.percona.com/u/Ivan_Pylypenko)
#### Post date: [April 5, 2023, 1:03pm UTC](https://forums.percona.com/t/help-configuring-postgres-operator-backup-section-of-cr-yaml/20947/7 "2023-04-05T13:03:31Z")

</div>

Hi Michael

Thank you for sharing your experience with us.

As for two backup storages engagement, we consider this as a bug and address it in the future releases. The issue sits in the pgbackrest helper utility running on backup initiator pod when needed, not the operator itself.

As for bucket name, the operator expects just a word or words-separated-with-hyphens. s3:// is not supported. Please try to recreate the cluster with suggested adjustments

Thank you.
