34 lines
892 B
BlitzBasic
34 lines
892 B
BlitzBasic
|
#!/usr/bin/env bb
|
||
|
|
||
|
(require '[dda.backup.cred-rot :as cr])
|
||
|
|
||
|
(def restic-repo {:password-file "/restic-pwd"
|
||
|
:restic-repository "/restic-repo"})
|
||
|
|
||
|
(def file-config (merge restic-repo {:backup-path "files"
|
||
|
:files ["/test-backup"]
|
||
|
:restore-target-directory "/test-restore"}))
|
||
|
|
||
|
(def cred-config (merge file-config
|
||
|
{:restic-repository "/restic-repo/files"
|
||
|
:new-password-config {:new-password-file "/new-pw"
|
||
|
:valid-from "2024-12-12 00:00:00"}}))
|
||
|
|
||
|
|
||
|
(def dry-run {:dry-run true :debug true})
|
||
|
|
||
|
(defn prepare!
|
||
|
[]
|
||
|
(spit "/restic-pwd" "ThePassword")
|
||
|
(spit "/new-pw" "newPassword"))
|
||
|
|
||
|
|
||
|
(defn change-password!
|
||
|
[]
|
||
|
(println "change-password!")
|
||
|
(cr/change-password! cred-config))
|
||
|
|
||
|
|
||
|
(prepare!)
|
||
|
(change-password!)
|