annotate blog/src/private/tools/backup.luan @ 658:e038905512d3

compile ReturnStmt
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 05 Apr 2016 18:38:29 -0600
parents cb6c628de583
children ca169567ce07
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Io = require "luan:Io"
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local Http = require "luan:http/Http"
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local Db = require "site:/lib/Db"
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 return function()
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 local backup = Io.uri "site:/private/local/backup.zip"
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 backup.delete()
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 Db.backup(backup.to_string())
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 Io.stdout = Http.response.text_writer()
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 %>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 <html>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <body>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 backed up to <a href="/private/local/backup.zip">/private/local/backup.zip</a>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 </body>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 </html>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 <%
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 end