No description
dev | ||
docs | ||
infrastructure/backup | ||
src/dda/backup | ||
test | ||
.cljstyle | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
.gitlab-ci.yml | ||
build.clj | ||
build.py | ||
CHANGELOG.md | ||
deps.edn | ||
LICENSE.md | ||
Makefile | ||
pom.xml | ||
README.md | ||
tests.edn |
dda-backup
chat over e-mail |
meissa@social.meissa-gmbh.de | Blog | Website
Images are available at https://hub.docker.com/r/domaindrivenarchitecture/dda-backup
Usage example
#!/usr/bin/env bb
(require '[babashka.tasks :as tasks]
'[dda.backup.restic :as rc]
'[dda.backup.backup :as bak]
'[dda.backup.restore :as rs])
(def config {:restic-repo
:debug true
:restic-repository "/restic-repo"
:password-file "/tmp/file_password"
:new-password-file "/tmp/file_new_password"
:backup-path "files"
:execution-directory "/var/backups/"
:files ["test-backup"]
:restore-target-directory "test-restore"})
(defn prepare!
[]
(tasks/shell "mkdir" "-p" "/var/backups/test-backup")
(spit "/var/backups/test-backup/file" "I was here")
(tasks/shell "mkdir" "-p" "/var/backups/test-restore"))
(defn restic-repo-init!
[]
(println "\nrestic-repo-init!")
(rc/init! config))
(defn restic-backup!
[]
(println "\nrestic-backup!")
(bak/backup-file! config))
(defn list-snapshots!
[]
(println "\nlist-snapshots!")
(rc/list-snapshots! config))
(defn restic-restore!
[]
(println "\nrestic-restore!")
(rs/restore-file! config))
(defn change-password!
[]
(println "\nchange-password!")
(rc/change-password! config))
(defn restic-backup-with-new!
[]
(println "\nrestic-backup with new!")
(bak/backup-file! (merge {:password-file "/tmp/file_new_password"} config)))
(defn list-snapshots-with-new!
[]
(println "\nlist-snapshots with new!")
(rc/list-snapshots! (merge {:password-file "/tmp/file_new_password"} config)))
(prepare!)
(restic-repo-init!)
(restic-backup!)
(list-snapshots!)
(restic-restore!)
(change-password!)
(restic-backup!)
(list-snapshots!)
(restic-restore!)
(restic-backup-with-new!)
(list-snapshots-with-new!)
Real Life Examples
see:
- https://repo.prod.meissa.de/meissa/c4k-taiga/src/branch/main/infrastructure/backup/image/resources
- https://repo.prod.meissa.de/meissa/c4k-forgejo/src/branch/main/infrastructure/backup/image/resources
Development & mirrors
Development happens at: https://repo.prod.meissa.de/meissa/dda-backup
Mirrors are:
- https://codeberg.org/meissa/dda-backup (Issues and PR)
- https://gitlab.com/domaindrivenarchitecture/dda-backup (CI)
For more details about our repository model see: https://repo.prod.meissa.de/meissa/federate-your-repos
License
Copyright © 2024, 2025 meissa GmbH Published under apache2.0 license Pls. find licenses of our subcomponents here