forked from hummypkg/webif
17ba0bb00e
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1837 2a923420-c742-0410-a762-8d5b09965624
49 lines
791 B
Plaintext
Executable File
49 lines
791 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/webif/lib/setup
|
|
|
|
httpheader
|
|
|
|
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
|
|
}
|
|
|
|
proc s_time {a b} {
|
|
file stat $a l
|
|
set at $l(ctime)
|
|
file stat $b l
|
|
set bt $l(ctime)
|
|
|
|
if {$at < $bt} { return -1 }
|
|
if {$at > $bt} { return 1 }
|
|
return 0
|
|
}
|
|
|
|
set backups [lsort -command s_time [glob -nocomplain "$dir/*.rbk"]]
|
|
|
|
if {![llength $backups]} {
|
|
empty
|
|
exit
|
|
}
|
|
|
|
foreach backup $backups {
|
|
set b [file rootname [file tail $backup]]
|
|
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>
|
|
"
|
|
}
|
|
|