Add basic dump_db.sh. We fight for the user! (or hacker, sysadmin, whatever)
This commit is contained in:
parent
3109a988c4
commit
1d18a32454
2 changed files with 26 additions and 0 deletions
17
examples/dump-db.lisp
Normal file
17
examples/dump-db.lisp
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||||
|
(ql:quickload '(coleslaw cl-store)))
|
||||||
|
|
||||||
|
(in-package :coleslaw)
|
||||||
|
|
||||||
|
(defun main ()
|
||||||
|
(let ((db-file (rel-path (user-homedir-pathname) ".coleslaw.db")))
|
||||||
|
(format t "~%~%Coleslaw loaded. Attempting to load config file.~%")
|
||||||
|
(load-config "")
|
||||||
|
(format t "~%Config loaded. Attempting to load blog content.~%")
|
||||||
|
(load-content)
|
||||||
|
(format t "~%Content loaded. Attempting to dump content database.~%")
|
||||||
|
(cl-store:store *site* db-file)
|
||||||
|
(format t "~%Content database saved to ~s!~%~%" (namestring db-file))))
|
||||||
|
|
||||||
|
(main)
|
||||||
|
(exit)
|
9
examples/dump_db.sh
Executable file
9
examples/dump_db.sh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
LISP=sbcl
|
||||||
|
|
||||||
|
## Disclaimer:
|
||||||
|
## I have not tested that all lisps take the "--load" flag.
|
||||||
|
## This code might spontaneously combust your whole everything.
|
||||||
|
|
||||||
|
$LISP --load "dump-db.lisp"
|
Loading…
Add table
Reference in a new issue