diff options
author | Steven Barth <steven@midlink.org> | 2008-11-09 20:09:43 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-11-09 20:09:43 +0000 |
commit | 93d2b0ec84e7f82979aa41b2399b0b3aa8300652 (patch) | |
tree | ba7e3ad329fa94f07f6c96da7795f61ce75e1585 /modules/admin-full/luasrc/controller/admin | |
parent | 0d7829638607013939064896b1432067d5302dbc (diff) |
Include backup date and hostname in backup archive name
Diffstat (limited to 'modules/admin-full/luasrc/controller/admin')
-rw-r--r-- | modules/admin-full/luasrc/controller/admin/system.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua index 1afdfc55ef..b6de148843 100644 --- a/modules/admin-full/luasrc/controller/admin/system.lua +++ b/modules/admin-full/luasrc/controller/admin/system.lua @@ -144,7 +144,8 @@ function action_backup() elseif backup then luci.util.perror(backup_cmd:format(_keep_pattern())) local backup_fpi = io.popen(backup_cmd:format(_keep_pattern()), "r") - luci.http.header('Content-Disposition', 'attachment; filename="backup.tar.gz"') + luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"' % { + luci.sys.hostname(), os.date("%Y-%m-%d")}) luci.http.prepare_content("application/x-targz") luci.ltn12.pump.all(luci.ltn12.source.file(backup_fpi), luci.http.write) elseif reset then |