annotate examples/blog/src/private/tools/backup.html.luan @ 1662:d6a50ed9604f

file.move_to
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 May 2022 19:15:42 -0600
parents 82415c9c0015
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1220
4721c482c86b cleaner Db example
Franklin Schmidt <fschmidt@gmail.com>
parents: 1217
diff changeset
1 local Luan = require "luan:Luan.luan"
4721c482c86b cleaner Db example
Franklin Schmidt <fschmidt@gmail.com>
parents: 1217
diff changeset
2 local error = Luan.error
693
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 597
diff changeset
3 local Io = require "luan:Io.luan"
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 597
diff changeset
4 local Http = require "luan:http/Http.luan"
1429
82415c9c0015 move versioning into Lucene
Franklin Schmidt <fschmidt@gmail.com>
parents: 1220
diff changeset
5 local Db = require "site:/lib/Db.luan"
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 return function()
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 local backup = Io.uri "site:/private/local/backup.zip"
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 backup.delete()
1429
82415c9c0015 move versioning into Lucene
Franklin Schmidt <fschmidt@gmail.com>
parents: 1220
diff changeset
11 Db.zip(backup)
597
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 Io.stdout = Http.response.text_writer()
1216
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
14 %>
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
15 <!doctype html>
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
16 <html>
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 <body>
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 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
19 </body>
1216
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
20 </html>
5dbb552075ff doctype
Franklin Schmidt <fschmidt@gmail.com>
parents: 789
diff changeset
21 <%
597
cb6c628de583 add blog tools
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 end