Created
August 13, 2023 15:19
-
-
Save macielti/98fcbabd882aba3ed78d5c3c567f23d7 to your computer and use it in GitHub Desktop.
Backup routine Datalevin Babashka script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require '[clojure.java.shell :refer [sh]]) | |
| (sh "docker" "exec" "global_datalevin" "dtlv" "-d" "/data/data" "copy" "/tmp/global_datalevin_backup") | |
| (def timestamp (quot (System/currentTimeMillis) 1000)) | |
| (let [[save-backup-to-file-path] *command-line-args*] | |
| (when (or (empty? save-backup-to-file-path)) | |
| (println "Usage: <save-backup-to-file-path>") | |
| (System/exit 1)) | |
| (sh "docker" "cp" "global_datalevin:/tmp/global_datalevin_backup/data.mdb" (str save-backup-to-file-path "-" timestamp))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment