Schelly is a backup tool focused on the scheduling part of a common backup routine, leaving the dirty job for specialized storage/database tools as it should. You can use any backup backend by just implementing a simple REST API specified here. This schelly compatible backup backend is called a Backup Provider.
The triggering and retainment of backups are based on the functional perception of backups, so you configure:
So, Schelly, based on those retention parameters, will call "POST /backup" or "DELETE /backup/{someid}" on backup backend server in order to maintain what we need as a backup that can save our souls!
Some Schelly compatible backends are Schelly Restic and Schelly Backy2. If you wish to create your own webhook bridge, try to use Schelly Webhook, a Go library that helps to create a Schelly compatible backup backend server.
Hope this can help you!
version: '3.5'
services:
schelly:
build:
context: .
target: IMAGE
ports:
- 8080:8080
environment:
- LOG_LEVEL=debug
- BACKUP_NAME=test
- WEBHOOK_URL=http://schelly-restic:7070/backups
- BACKUP_CRON_STRING=0/3 * * * * *
- RETENTION_MINUTELY=10
schelly-restic:
image: flaviostutz/schelly-restic
ports:
- 7070:7070
environment:
- RESTIC_PASSWORD=123
- LOG_LEVEL=debug
- PRE_BACKUP_COMMAND=dd if=/dev/zero of=/backup-source/TESTFILE bs=100MB count=2
- POST_BACKUP_COMMAND=rm /backup-source/TESTFILE
- SOURCE_DATA_PATH=/backup-source/TESTFILE
- TARGET_DATA_PATH=/backup-repo
docker-compose up and see logscurl localhost:7070/backupsGET /backups
Query backups managed by Schelly
Query params:
Request body: none
Request header: none
Response body: json
{
id:{same id as returned by underlying webhook on backup creation},
status:{backup-status}
start_time:{time of backup trigger on webhook}
end_time:{time of backup finish detection}
custom_data:{data returned from webhook}
tags: {array of tags}
}
Status code 201 if created successfully
POST /backups
Trigger a new backup now
Request body: none
Request header: none
Response body: json
{
id:{same id as returned by underlying webhook on backup creation},
status:{backup-status}
start_time:{time of backup trigger on webhook}
end_time:{time of backup finish detection}
custom_data:{data returned from webhook}
}
will be invoked when Schelly needs to create/delete a backup on a backend server
The webhook server must expose the following REST endpoints:
POST {webhook-url}
Invoked when Schelly wants to trigger a new backup
Request body: json {webhook-create-body}
Request header: {webhook-headers}
Response body: json
{
id:{alphanumeric-backup-id},
status:{backup-status},
message:{backend-message}
}
GET {webhook-url}/{backup-id}
Invoked when Schelly wants to query a specific backup instance
Request header: {webhook-headers}
Response body: json
{
id:{id},
data_id:{underlaying data id, or the same as id when not known yet},
status:{backup-status},
message:{backend message}
size_mb:{backup-size-mbytes}
}
Status code: 200 if found, 404 if not found
data_id: the backup creation webhook (POST /backups) must return immediately with a backup id that can be used for later cancellation (DELETE /backups/{id}). In many cases, the backup webhook creates an id for the backup before the underlying data backup is called or even finished (for example, when there are pre-backup commands or the backup storage mechanism only returns an id when finished). This field will have the underlying data storage backup id so that you will know what is the real reference in the underlying storage when you need to restore or manage it.
DELETE {webhook-url}/{backup-id}
{webhook-delete-body}{webhook-headers}Default backup
Simple daily backups
Every 4 hours backups
Schelly has a /metrics endpoint compatible with Prometheus. See https://github.com/flaviostutz/schelly-grafana
git clone this repo and docker-compose build
Please submit your issues and pull requests here!
Schelly will avoid performing concurrent invocations on webhook API
Schelly will avoid performing concurrent invocations on webhook API
If a backup fails (POST /backup webhook returns something different from 201), it will wait 5 seconds and retry again until 'grace time'
If a backup deletion fails (DELETE /backup/{backupid} returns something different from 200), it will mark backup with status 'delete-error' and once a day will randomly retry to delete some of them.
Content type
Image
Digest
Size
290.3 MB
Last updated
about 7 years ago
docker pull jairsjunior/schelly