################################################# # Function definitions for afs dump type ################################################# proc afs_dump {host atom level} { global sessionID logdir tmpdir set hostlogfile $tmpdir/BURTlog.${sessionID}.$host.$atom.$level.afs set time 0 if { $level > 0 } { if ![catch {exec /s/std/bin/grep -F " $atom [expr $level - 1] afs" $logdir/afsepochcache.log} result] { foreach line [split $result \n] { array set info $line set foo [lindex [split $info(log) .] 1] if { $foo > $time } { set time $foo } } set time [clock format $time -format "%D"] } } set dumpfd [open "|/usr/afsws/etc/vos dump -id $atom -time $time 2> $hostlogfile" {RDONLY NONBLOCK}] set stderrfd [open $hostlogfile r] return [list $dumpfd $stderrfd] } proc afs_cleanup {host atom level} { global sessionID tmpdir set hostlogfile $tmpdir/BURTlog.${sessionID}.$host.$atom.$level.afs catch {file delete $hostlogfile} } proc afs_check {host atom level line} { if { [regexp {Dumped volume} $line] || [regexp {in stdout} $line] } { return 0 } else { return 1 } } proc afs_recover {host atom level} { return [open "$atom.$level.burt" w] } proc afs_schedule {line} { global logfilefd foreach {atom level type} $line {} if { [regexp {\.backup$} $atom] == 0 } { append atom ".backup" } regsub {\.cs\.wisc\.edu} [lindex [exec vos exa $atom] 6] {} host schedule add $host $atom $level $type puts $logfilefd "BURT: Scheduling $host $atom $level $type" }