Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. Retention policy - 1 day possible?

Retention policy - 1 day possible?

Scheduled Pinned Locked Moved Feature Requests
backupretention
10 Posts 4 Posters 177 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    djxx
    wrote last edited by
    #1

    Using Cloudron version 9, under Configure Backup Schedule & Retention is it possible to get an option for 1 day?

    I store my backups on a ZFS pool, so I automatically get daily, weekly, and monthly snapshots of my data. Having this as 2 days causes me to spend 2x the storage space (and bandwidth) on backups.

    1 Reply Last reply
    1
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote last edited by
      #2

      Hello @djxx
      Currently, no. The minimum is two days.
      I am converting your topic into a feature request.

      1 Reply Last reply
      1
      • jamesJ james marked this topic as a regular topic
      • jamesJ james moved this topic from Support
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote last edited by
        #3

        This is possible via the API, just not via the UI.

        D 1 Reply Last reply
        1
        • girishG girish

          This is possible via the API, just not via the UI.

          D Offline
          D Offline
          djxx
          wrote last edited by
          #4

          @girish Great! Can you give an example of how, or point me to the documentation?

          1 Reply Last reply
          0
          • jamesJ Offline
            jamesJ Offline
            james
            Staff
            wrote last edited by
            #5

            Hello @djxx
            The API Documentation is still outdated.
            But I can guide you.
            Create yourself a Cloudron API Token, see https://docs.cloudron.io/profile#api-tokens

            Get your backup site ID

            export CLOUDRON_ACCESS_TOKEN="YOUR_TOKEN_GOES_HERE"
            curl "https://my.cloudron.dev/api/v1/backup_sites?page=1&per_page=1000&access_token=${CLOUDRON_ACCESS_TOKEN}"
            

            Example Output:

            {
              "backupSites": [
                {
                  "id": "3db47cce-dab7-46b6-9db3-1892ab14cd21",
                  "name": "default",
                  "provider": "filesystem",
                  "schedule": "00 00 23 * * *",
                  "format": "tgz",
                  "enableForUpdates": true,
                  "creationTime": "2025-10-10T08:12:57.000Z",
                  "ts": "2025-11-10T11:22:44.000Z",
                  "config": {
                    "backupDir": "/var/backups"
                  },
                  "limits": {
                    "memoryLimit": 1073741824,
                    "uploadPartSize": 10485760,
                    "syncConcurrency": 10,
                    "downloadConcurrency": 10,
                    "copyConcurrency": 10
                  },
                  "retention": {
                    "keepWithinSecs": 172800
                  },
                  "integrityKeyPair": {
                    "publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAZ18PRnLfQIf08IKl9bf9YkIHL7zT2eeeRJ8XuCx1+C0=\n-----END PUBLIC KEY-----\n"
                  },
                  "contents": null,
                  "encrypted": false,
                  "encryptedFilenames": false,
                  "encryptionPasswordHint": null
                }
              ]
            }
            

            So the backup site ID is 3db47cce-dab7-46b6-9db3-1892ab14cd21.

            Set the retention time in seconds:

            export BACKUPSITE_ID="3db47cce-dab7-46b6-9db3-1892ab14cd21"
            curl "https://my.cloudron.dev/api/v1/backup_sites/${BACKUPSITE_ID}/configure/retention?access_token=${CLOUDRON_ACCESS_TOKEN}" \
              -H 'content-type: application/json' \
              --data-raw '{"retention":{"keepWithinSecs":86400}}'
            

            This will lead to a little buggy looking dashboard since there is no display option for values outside of the avaiable selections.

            Normal 2 Days:
            821b8ddd-60a8-49f5-bc09-2b7759c67048-image.png

            Set to 86400 seconds = 1 Day:
            240788f1-b06c-408e-af32-4f346e3758d4-image.png

            D 1 Reply Last reply
            1
            • jamesJ james

              Hello @djxx
              The API Documentation is still outdated.
              But I can guide you.
              Create yourself a Cloudron API Token, see https://docs.cloudron.io/profile#api-tokens

              Get your backup site ID

              export CLOUDRON_ACCESS_TOKEN="YOUR_TOKEN_GOES_HERE"
              curl "https://my.cloudron.dev/api/v1/backup_sites?page=1&per_page=1000&access_token=${CLOUDRON_ACCESS_TOKEN}"
              

              Example Output:

              {
                "backupSites": [
                  {
                    "id": "3db47cce-dab7-46b6-9db3-1892ab14cd21",
                    "name": "default",
                    "provider": "filesystem",
                    "schedule": "00 00 23 * * *",
                    "format": "tgz",
                    "enableForUpdates": true,
                    "creationTime": "2025-10-10T08:12:57.000Z",
                    "ts": "2025-11-10T11:22:44.000Z",
                    "config": {
                      "backupDir": "/var/backups"
                    },
                    "limits": {
                      "memoryLimit": 1073741824,
                      "uploadPartSize": 10485760,
                      "syncConcurrency": 10,
                      "downloadConcurrency": 10,
                      "copyConcurrency": 10
                    },
                    "retention": {
                      "keepWithinSecs": 172800
                    },
                    "integrityKeyPair": {
                      "publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAZ18PRnLfQIf08IKl9bf9YkIHL7zT2eeeRJ8XuCx1+C0=\n-----END PUBLIC KEY-----\n"
                    },
                    "contents": null,
                    "encrypted": false,
                    "encryptedFilenames": false,
                    "encryptionPasswordHint": null
                  }
                ]
              }
              

              So the backup site ID is 3db47cce-dab7-46b6-9db3-1892ab14cd21.

              Set the retention time in seconds:

              export BACKUPSITE_ID="3db47cce-dab7-46b6-9db3-1892ab14cd21"
              curl "https://my.cloudron.dev/api/v1/backup_sites/${BACKUPSITE_ID}/configure/retention?access_token=${CLOUDRON_ACCESS_TOKEN}" \
                -H 'content-type: application/json' \
                --data-raw '{"retention":{"keepWithinSecs":86400}}'
              

              This will lead to a little buggy looking dashboard since there is no display option for values outside of the avaiable selections.

              Normal 2 Days:
              821b8ddd-60a8-49f5-bc09-2b7759c67048-image.png

              Set to 86400 seconds = 1 Day:
              240788f1-b06c-408e-af32-4f346e3758d4-image.png

              D Offline
              D Offline
              djxx
              wrote last edited by
              #6

              @james Thanks! This was helpful. I made this change. Looking forward to the next sync so I can see if the data has been cut in half.

              1 Reply Last reply
              3
              • nebulonN Offline
                nebulonN Offline
                nebulon
                Staff
                wrote last edited by
                #7

                @djxx did this work out for you in the end?

                D 1 Reply Last reply
                0
                • nebulonN nebulon

                  @djxx did this work out for you in the end?

                  D Offline
                  D Offline
                  djxx
                  wrote last edited by
                  #8

                  @nebulon Thanks for checking! The UI change did take effect, and I do see a reduction of backup size - but it's not down to 1x the size of the backup. It's still 2x the size of the backup.

                  Inside the remote storage folder, I see:

                  • storage
                  • 2026-01-03-150000-664
                  • all other backups before

                  It looks like the latest backup also has a copy in "storage", which is still resulting in 2x the backup space for each snapshot being taken - because each day "storage" will change, and there will be a new folder added.

                  1 Reply Last reply
                  0
                  • nebulonN Offline
                    nebulonN Offline
                    nebulon
                    Staff
                    wrote last edited by
                    #9

                    This is a guess, but do you mean "snapshot" instead of "storage" ? If so yes the snapshot contains the first snapshot of the app and then the data is rotated (copied) over from there to the final destination. This does add one extra storage on disk of the same data.

                    To avoid having this extra copy on disk, you can use the rsync storage format with hardlinks.

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      djxx
                      wrote last edited by
                      #10

                      Yes - you're right it's "storage". I have been meaning to try the rsync instead of zip, but it does warn that it's not a good idea for lots of files. I'll give it a try. Thanks!

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search