Mercurial Hosting > luan
annotate examples/blog/src/private/tools/backup.luan @ 1216:5dbb552075ff
doctype
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 20 Mar 2018 15:27:08 -0600 |
parents | e2eb55d86bb2 |
children |
rev | line source |
---|---|
693
ca169567ce07
module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
597
diff
changeset
|
1 local Io = require "luan:Io.luan" |
ca169567ce07
module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
597
diff
changeset
|
2 local Http = require "luan:http/Http.luan" |
ca169567ce07
module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
597
diff
changeset
|
3 local Db = require "site:/lib/Db.luan" |
597 | 4 |
5 | |
6 return function() | |
7 local backup = Io.uri "site:/private/local/backup.zip" | |
8 backup.delete() | |
789 | 9 Db.zip(backup) |
597 | 10 |
11 Io.stdout = Http.response.text_writer() | |
1216 | 12 %> |
13 <!doctype html> | |
14 <html> | |
597 | 15 <body> |
16 backed up to <a href="/private/local/backup.zip">/private/local/backup.zip</a> | |
17 </body> | |
1216 | 18 </html> |
19 <% | |
597 | 20 end |