Retention policy - 1 day possible?
-
Using Cloudron version 9, under
Configure Backup Schedule & Retentionis 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.
-
J james marked this topic as a regular topic
-
J james moved this topic from Support
-
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-tokensGet 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:

Set to
86400seconds = 1 Day:

-
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-tokensGet 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:

Set to
86400seconds = 1 Day:
