#!/mod/bin/jimsh package require cgi puts "Content-Type: text/html" puts "Pragma: no-cache" puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT" puts "" set dir "/mod/var/backup" proc empty {} { puts " No current backup files. " } 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 "$b ( [clock format [file mtime $backup] -format {%c %Z}] )
" }