This procedure is defined in the server but not documented via ad_proc or proc_doc and may be intended as a private interface.
The procedure is defined as:
proc ns::stats::linuxBackupSnapshot {archivePrefix procRoot} {
set result [dict create configured [expr {$archivePrefix ne ""}] available false active false processCount 0 blockedCount 0]
if {$archivePrefix eq "" || ![string equal -nocase Linux $::tcl_platform(os)]
|| ![string match {/*} $archivePrefix] || ![string match {/*} $procRoot]
|| ![file isdirectory $procRoot]} {
return $result
}
dict set result available true
foreach directory [glob -nocomplain -types d -directory $procRoot {[0-9]*}] {
set pid [file tail $directory]
if {![string is integer -strict $pid]} {continue}
set command [::ns::stats::linuxReadFile $directory/cmdline]
if {$command eq ""} {continue}
set args [split [string trimright $command \0] \0]
if {[file tail [lindex $args 0]] ne "tar"} {continue}
set archive ""
for {set i 1} {$i<[llength $args]} {incr i} {
set arg [lindex $args $i]
if {$arg in {--file -f} && $i+1<[llength $args]} {
set archive [lindex $args [incr i]]
} elseif {[string match {--file=*} $arg]} {
set archive [string range $arg 7 end]
}
}
if {[string first $archivePrefix $archive] != 0} {continue}
# A second read ensures that the matched process still exists. Parse
# the final ")" because Linux process names may contain parentheses.
set stat [::ns::stats::linuxReadFile $directory/stat]
if {![regexp {^[0-9]+ \(.*\) ([A-Z]) } $stat -> state]} {continue}
dict incr result processCount
if {$state eq "D"} {dict incr result blockedCount}
}
dict set result active [expr {[dict get $result processCount]>0}]
return $result
}