2011-07-05 18:38:42 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
|
|
|
|
|
|
|
puts "Content-Type: text/html"
|
2011-07-11 23:29:21 +00:00
|
|
|
puts "Pragma: no-cache"
|
2011-07-05 18:38:42 +00:00
|
|
|
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
|
|
|
|
puts ""
|
|
|
|
|
|
|
|
set dir "/mod/var/backup"
|
|
|
|
|
|
|
|
proc empty {} {
|
|
|
|
puts "<font style=\"color: grey\">
|
|
|
|
<i>No current backup files.</i>
|
|
|
|
</font>"
|
|
|
|
}
|
|
|
|
|
|
|
|
if {![file isdirectory $dir]} {
|
|
|
|
empty
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2011-07-05 22:59:34 +00:00
|
|
|
set backups [glob -nocomplain "$dir/*.rbk"]
|
2011-07-05 18:38:42 +00:00
|
|
|
|
|
|
|
if {![llength $backups]} {
|
|
|
|
empty
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2011-07-05 22:59:34 +00:00
|
|
|
foreach backup $backups {
|
|
|
|
set b [file rootname [file tail $backup]]
|
2011-07-05 18:38:42 +00:00
|
|
|
puts "<input name=restore_file class=restore
|
|
|
|
type=radio value=\"$b\">$b <font class=footnote>(
|
|
|
|
[clock format [file mtime $backup] -format {%c %Z}]
|
|
|
|
)</font></input>
|
|
|
|
<br>
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|