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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Hack a custom backup Retention and Schedule

    App Packaging & Development
    2
    7
    278
    Loading More Posts
    • 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.
    • robi
      robi last edited by robi

      Can we do something like pick one of the least appealing options for backup/retention options and manually change the numbers in box code behind the scenes, so that we get the custom timing we desire w/o losing the config as Cloudron updates? (unless we change the UI backup options again)

      Will anything overwrite this other than UI selection?

      That way at least advanced users can tune their fleet. 🙂

      Life of Advanced Technology

      fbartels 1 Reply Last reply Reply Quote 0
      • fbartels
        fbartels App Dev @robi last edited by

        Hi @robi,

        what kind of settings do you want to change? I would always discourage changing source files, simply because any update could potentially overwrite the custom changes.

        Even if retention and schedule patterns
        are not part of the documentation, looking in the browser console they still can be set with a simple curl request.

        curl 'https://my.xxx/api/v1/settings/backup_config' \
          -H 'authorization: Bearer xxx' \
          --data-raw '{"provider":"minio","format":"tgz","bucket":"xxx-9wdeu","prefix":"","accessKeyId":"xxx","secretAccessKey":"●●●●●●●●","endpoint":"https://xxx","region":"us-east-1","acceptSelfSignedCerts":false,"s3ForcePathStyle":true,"retentionPolicy":{"keepWithinSecs":2592000},"schedulePattern":"00 00 23 * * *","memoryLimit":8589934592,"uploadPartSize":20971520,"password":"●●●●●●●●"}' \
          --compressed
        
        robi 1 Reply Last reply Reply Quote 3
        • robi
          robi @fbartels last edited by

          @fbartels Thanks for this.. the two main things are retention beyond the options available and a possibly more dynamic schedule (thanks to your API example).

          One system we have is doing hourly local backups to keep important content from being lost, which is a lot, however there isn't a retention config that fits the needs. Hence a custom setting would be peachy.

          Once remote backups begin, some of those destinations have storage limitations and again the retention needs adjusting to keep within those limits w/o doubling costs, etc..

          The only other thing that would be missing is more data on size of backups directly so it doesn't have to be figured out via other indirect means (like looking back from remote backup sources how much is used, we should know how much is intended to be written.)

          Life of Advanced Technology

          fbartels 1 Reply Last reply Reply Quote 0
          • fbartels
            fbartels App Dev @robi last edited by

            @robi so the change you need is rather a retention based on backup size?

            robi 1 Reply Last reply Reply Quote 0
            • robi
              robi @fbartels last edited by robi

              @fbartels

              o Happyness level 1 - custom static retention
              o Happyness level 2 - custom dynamic retention based on backup size, yes
              o Happyness level 3 - custom dynamic retention based on level 2 with thresholds AND different destinations (of different sizes, including local)

              Life of Advanced Technology

              fbartels 1 Reply Last reply Reply Quote 0
              • fbartels
                fbartels App Dev @robi last edited by

                @robi retention by time you could already set through keepWithinSecs i would say.

                For the rest (although i would rather recommend to work on the storage limitations) maybe it would be an alternative to backup the Cloudron to disk and have another application pick up the moving to storage and rotation/retention part. There was a restic how to here recently that could help.

                robi 1 Reply Last reply Reply Quote 3
                • robi
                  robi @fbartels last edited by

                  @fbartels Yes, hence the ask for a single place to
                  set it, so it's in use until changed and the change survives updates.

                  Life of Advanced Technology

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB