Compare commits

...

13 Commits

Author SHA1 Message Date
moritz fa5078eb6e Merge pull request 'chore(deps): update docker docker tag to v29.4.3' (#87) from renovate/docker-29.x into main
Reviewed-on: coop-cloud/backup-bot-two#87
2026-05-12 12:27:35 +00:00
renovate-bot 3bbef4a0de chore(deps): update docker docker tag to v29.4.3 2026-05-12 12:27:22 +00:00
moritz f3924969e8 Merge pull request 'fix backup download instruction and some beautifying' (#90) from doc-download into main
Reviewed-on: coop-cloud/backup-bot-two#90
2026-05-12 12:26:44 +00:00
stevensting ff7c9c5cd8 fix backup download instruction and some beautifying 2026-05-12 12:26:07 +00:00
moritz 25f977c312 Merge pull request 'fix: Use actual CRON_SCHEDULE for swarm-cronjob instead of demo */5' (#88) from fix/3wc/swarm-cronjob-schedule into main
Reviewed-on: coop-cloud/backup-bot-two#88
Reviewed-by: decentral1se <decentral1se@noreply.git.coopcloud.tech>
2026-05-11 15:44:24 +00:00
3wordchant 6255edc834 fix: Use actual CRON_SCHEDULE for swarm-cronjob instead of demo */5 2026-04-11 16:59:25 -04:00
moritz c17c3f0273 chore: publish 2.4.0+2.4.0 release 2026-03-31 19:00:05 +02:00
moritz b1051c7a35 chore(deps): update resticpy to 1.3.0 2026-03-31 18:59:50 +02:00
moritz c2cb524710 fix cronjob output 2026-03-31 18:53:06 +02:00
moritz 1a617f0942 Merge pull request 'chore(deps): update docker docker tag to v29' (#81) from renovate/docker-29.x into main
Reviewed-on: coop-cloud/backup-bot-two#81
2026-03-31 12:30:33 +00:00
renovate-bot dd85f389f4 chore(deps): update docker docker tag to v29 2026-03-25 19:31:23 +00:00
3wordchant 4d7d8fc577 Merge pull request 'fix docs typo' (#83) from hermzz/backup-bot-two:docs-typo into main
Reviewed-on: coop-cloud/backup-bot-two#83
2026-03-14 03:37:22 +00:00
hermzz ef4f0ec87e fix docs typo 2026-03-13 22:30:51 -04:00
6 changed files with 28 additions and 28 deletions
+3 -4
View File
@@ -1,11 +1,10 @@
FROM docker:24.0.7-dind
FROM docker:29.4.3-dind
RUN apk add --upgrade --no-cache restic bash python3 py3-pip py3-click py3-docker-py py3-json-logger curl
# Todo use requirements file with specific versions
RUN pip install --break-system-packages resticpy==1.0.2
RUN pip install --break-system-packages resticpy==1.3.0
COPY backupbot.py /usr/bin/backup
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+18 -16
View File
@@ -79,7 +79,7 @@ Add the key to your `authorized_keys`:
`ssh-copy-id -i backupkey <user>@<hostname>`
Add your `SSH_KEY` as docker secret:
```
cat backupkey | app secret insert <backupbot_name> ssh_key v1
cat backupkey | abra app secret insert <backupbot_name> ssh_key v1
```
### Restic REST server Storage
@@ -137,55 +137,57 @@ Enable basic auth in the env file, by uncommenting the following line:
## Usage
Run the cronjob that creates a backup, including the push notifications and docker logging:
### Run the cronjob that creates a backup, including the push notifications and docker logging:
`abra app cmd <backupbot_name> app run_cron`
Create a backup of all apps:
### Create a backup of all apps:
`abra app run <backupbot_name> app -- backup create`
> The apps to backup up need to be deployed
Create an individual backup:
### Create an individual backup:
`abra app run <backupbot_name> app -- backup --host <target_app_name> create`
Create a backup to a local repository:
### Create a backup to a local repository:
`abra app run <backupbot_name> app -- backup create -r /backups/restic`
> It is recommended to shutdown/undeploy an app before restoring the data
Restore the latest snapshot of all including apps:
### Restore the latest snapshot of all including apps:
`abra app run <backupbot_name> app -- backup restore`
Restore a specific snapshot of an individual app:
### Restore a specific snapshot of an individual app:
`abra app run <backupbot_name> app -- backup --host <target_app_name> restore --snapshot <snapshot_id>`
Show all snapshots:
### Show all snapshots:
`abra app run <backupbot_name> app -- backup snapshots`
Show all snapshots containing a specific app:
### Show all snapshots containing a specific app:
`abra app run <backupbot_name> app -- backup --host <target_app_name> snapshots`
Show all files inside the latest snapshot (can be very verbose):
### Show all files inside the latest snapshot (can be very verbose):
`abra app run <backupbot_name> app -- backup ls`
Show specific files inside a selected snapshot:
### Show specific files inside a selected snapshot:
`abra app run <backupbot_name> app -- backup ls --snapshot <snapshot_id> /var/lib/docker/volumes/`
Download files from a snapshot:
### Download files from a snapshot:
```
filename=$(abra app run <backupbot_name> app -- backup download --snapshot <snapshot_id> --path <absolute_path>)
abra app cp <backupbot_name> app:$filename .
```
`abra app run <backupbot_name> app -- backup download --snapshot <snapshot_id> --path <absolute_path>`
extract the <path> from the output of the first command and use in the second.
`abra app cp <backupbot_name> app:<path> .`
## Run restic
+1 -1
View File
@@ -1,6 +1,6 @@
export SSH_CONFIG_VERSION=v1
export ENTRYPOINT_VERSION=v17
export CRONJOB_VERSION=v2
export CRONJOB_VERSION=v3
run_cron () {
schedule="$(crontab -l | tr -s " " | cut -d ' ' -f-5)"
+1 -3
View File
@@ -7,9 +7,7 @@ services:
replicas: 0
labels:
- "swarm.cronjob.enable=true"
# Note(3wc): every 5m, testing
- "swarm.cronjob.schedule=*/5 * * * *"
# Note(3wc): blank label to be picked up by `abra recipe sync`
- "swarm.cronjob.schedule=${CRON_SCHEDULE}"
restart_policy:
condition: none
entrypoint: [ "/usr/bin/backup.sh" ]
+2 -2
View File
@@ -2,7 +2,7 @@
version: "3.8"
services:
app:
image: git.coopcloud.tech/coop-cloud/backup-bot-two:2.3.0-beta
image: git.coopcloud.tech/coop-cloud/backup-bot-two:2.4.0
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/var/lib/docker/volumes/:/var/lib/docker/volumes/"
@@ -23,7 +23,7 @@ services:
mode: 666
deploy:
labels:
- coop-cloud.${STACK_NAME}.version=2.3.0+2.3.0-beta
- coop-cloud.${STACK_NAME}.version=2.4.0+2.4.0
- coop-cloud.${STACK_NAME}.timeout=${TIMEOUT}
- coop-cloud.backupbot.enabled=true
#entrypoint: ['tail', '-f','/dev/null']
+3 -2
View File
@@ -4,7 +4,7 @@ set -e
CURL_OPTS="-s"
# Check for basic auth
if [ -n "$(cat /run/secrets/push_basicauth)" ]
if [ -s /run/secrets/push_basicauth ]
then
CURL_OPTS="$CURL_OPTS -u $(cat /run/secrets/push_basicauth)"
fi
@@ -32,7 +32,8 @@ else
fi
eval "$push_start_notification"
if [ "$(backup --machine-logs create 2>&1 | tee /tmp/backup.log && (grep -q 'backup finished' /tmp/backup.log))" ]
backup --machine-logs create 2>&1 | tee /tmp/backup.log
if grep -q 'backup finished' /tmp/backup.log
then
eval "$push_success_notification"
else