comparison src/luan/modules/host/restore.luan @ 1567:349eef23a13c

lucene named backup
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 14 Nov 2020 20:05:07 -0700
parents 1a68fc55a80c
children
comparison
equal deleted inserted replaced
1566:364859d29ff5 1567:349eef23a13c
3 local Io = require "luan:Io.luan" 3 local Io = require "luan:Io.luan"
4 local print = Io.print or error() 4 local print = Io.print or error()
5 local uri = Io.uri or error() 5 local uri = Io.uri or error()
6 local Hosting = require "luan:host/Hosting.luan" 6 local Hosting = require "luan:host/Hosting.luan"
7 7
8 if #{...} ~= 2 then 8 if #{...} ~= 3 then
9 Io.stderr.write "usage: luan luan:host/restore.luan domain password\n" 9 Io.stderr.write "usage: luan luan:host/restore.luan domain password name\n"
10 return 10 return
11 end 11 end
12 12
13 local domain, password = ... 13 local domain, password, name = ...
14 14
15 local zip_file = uri("file:backup.zip") 15 local zip_file = uri("file:backup.zip")
16 zip_file.exists() or error "backup.zip not found" 16 zip_file.exists() or error "backup.zip not found"
17 Hosting.caller(domain).lucene_restore(password,zip_file) 17 Hosting.caller(domain).lucene_restore(password,name,zip_file)
18 18
19 print("restored lucene from backup.zip to "..domain) 19 print("restored lucene from backup.zip to "..domain)