loghole.1 12.9 KB
Newer Older
Timothy Stack's avatar
 
Timothy Stack committed
1 2
.\"
.\" EMULAB-COPYRIGHT
Timothy Stack's avatar
 
Timothy Stack committed
3
.\" Copyright (c) 2004, 2005 University of Utah and the Flux Group.
Timothy Stack's avatar
 
Timothy Stack committed
4 5
.\" All rights reserved.
.\"
Timothy Stack's avatar
 
Timothy Stack committed
6
.TH LOGHOLE 1 "June 16, 2005" "Emulab" "Emulab Commands Manual"
Timothy Stack's avatar
 
Timothy Stack committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
.OS
.SH NAME
loghole \- Log management tool for experiments.
.SH SYNOPSIS
.BI loghole
[\fB-hVdqva\fR]
[\fB-e \fIpid\fR/\fIeid\fR]
[\fB-s \fIserver\fR]
[\fB-P \fIport\fR]
.I action
[\fI...\fR]
.P
.BI loghole
.BI sync
[\fInode1 node2 ...\fR]
.P
.BI loghole
.BI archive
[\fB-k \fR(\fBi-delete\fR|\fBspace-is-needed\fR)]
[\fB-a \fIdays\fR]
[\fB-c \fIcomment\fR]
[\fB-d\fR]
[\fIarchive-name\fR]
.P
.BI loghole
Timothy Stack's avatar
 
Timothy Stack committed
32 33 34 35 36 37 38 39
.BI change
[\fB-k \fR(\fBi-delete\fR|\fBspace-is-needed\fR)]
[\fB-a \fIdays\fR]
[\fB-c \fIcomment\fR]
.I archive-name1
[\fIarchive-name2 ...\fR]
.P
.BI loghole
Timothy Stack's avatar
 
Timothy Stack committed
40 41 42 43 44 45 46 47 48 49
.BI list
[\fB-O1!Xo\fR]
[\fB-m \fIatmost\fR]
[\fB-s \fImegabytes\fR]
.P
.BI loghole
.BI show
[\fIarchive-name\fR]
.P
.BI loghole
Timothy Stack's avatar
 
Timothy Stack committed
50
.BI clean
Timothy Stack's avatar
 
Timothy Stack committed
51 52
[\fB-fne\fR]
[\fInode1 node2 ...\fR]
Timothy Stack's avatar
 
Timothy Stack committed
53 54
.P
.BI loghole
Timothy Stack's avatar
 
Timothy Stack committed
55 56 57 58 59 60 61
.BI gc
[\fB-n\fR]
[\fB-m \fIatmost\fR]
[\fB-s \fImegabytes\fR]
.SH DESCRIPTION
The
.B loghole
Timothy Stack's avatar
 
Timothy Stack committed
62 63 64
utility downloads log files from certain directories on the experimental nodes
(e.g. "/local/logs") to the Emulab users machine.  After downloading, it can
also be used to produce and manage archives of the log files.  Using this
Timothy Stack's avatar
 
Timothy Stack committed
65 66
utility to manage an experiment's log files is encouraged because it will
transfer the logs in a network-friendly manner and is already integrated with
Timothy Stack's avatar
 
Timothy Stack committed
67 68 69 70
the rest of Emulab.  For example, any programs executed using the Emulab
event-system will have their standard output/error automatically placed in the
"/local/logs" directory.  The tool can also be used to preserve multiple trials
of an experiment by producing and managing zip archives of the logs.
Timothy Stack's avatar
 
Timothy Stack committed
71 72 73 74 75
.P
The set of logs that are actually downloaded by the tool are those located in
.I logholes
on the nodes, where a loghole is simply a well-known directory that acts like a
blackhole for log files.  Any files found in these directories are downloaded
Timothy Stack's avatar
 
Timothy Stack committed
76 77 78 79
to the experiment's log directory (i.e. "/proj/<pid>/exp/<eid>/logs") and
placed under separate directories for each node and loghole.  The referent of
symbolic links are also downloaded, so if you do not want an entire directory
downloaded, you can create links in a loghole to those files of interest.
Timothy Stack's avatar
 
Timothy Stack committed
80
.P
Timothy Stack's avatar
 
Timothy Stack committed
81
To perform its various tasks, the
Timothy Stack's avatar
 
Timothy Stack committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
.B loghole
utility is broken up into several sub-actions that you can apply to an
experiment's log holes or log archives.  As a quick example, to synchronize the
logholes for the experiment "neptune/myexp" and create an archive of these logs
you would run:
.RS
.P
.PD 0
[vmars@users ~] loghole -e neptune/myexp sync
.PP
[vmars@users ~] loghole -e neptune/myexp archive
.PD
.RE
.P
The following listing gives a brief overview of the current set of actions,
more detail can be found in later sections of this manual:
.TP
.B sync
Synchronize the experiment's log holes on the nodes with the experiment's log
directory.
.TP
.B archive
Archive the contents of the experiment's log directory into a zip file.
.TP
Timothy Stack's avatar
 
Timothy Stack committed
106 107 108
.B change
Change the metadata of an existing archive.
.TP
Timothy Stack's avatar
 
Timothy Stack committed
109 110 111 112 113 114
.B list
Print a brief listing of the archives in the experiment's log directory.
.TP
.B show
Print a detailed listing of the archives in the experiment's log directory.
.TP
Timothy Stack's avatar
 
Timothy Stack committed
115
.B clean
Timothy Stack's avatar
 
Timothy Stack committed
116 117
Clean out the experiment log directory by removing any subdirectories and/or
clean the log directories on the nodes.
Timothy Stack's avatar
 
Timothy Stack committed
118
.TP
Timothy Stack's avatar
 
Timothy Stack committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
.B gc
Garbage collect old archives to free up disk space.
.P
Options passed to the utility are split between globally applicable ones that
are placed before the action and action-specific options that are placed after.
For example, the
.B -a
global option will apply an action to all of your experiments and the
.B -X
option for the
.B list
action will list only those files that will be deleted at the next garbage
collection.  To combine these options you would enter:
.RS
.P
[vmars@users ~] loghole -a list -X
.RE
.P
The set of global options is as follows:
.TP
\fB-h\fR, \fB--help
Print the usage message for the
.B loghole
utility as a whole or, if an action is given, the usage message for that
action.
.TP
\fB-V\fR, \fB--version
Print out version information and exit.
.TP
\fB-d\fR, \fB--debug
Output debugging messages.
.TP
\fB-q\fR, \fB--quiet
Decrease the level of verbosity, this is subtractive, so multiple uses of this
option will make the utility quieter and quieter.  The default level of
verbosity is human-readable, below that is machine-readable, and below that is
silent.  For example, the default output from the "list" action looks like:
.P
.RS
.RS
.PD 0
[ ] foobar.1.zip   10/15
.P
[!] foobar.0.zip   10/13
.RE
.PD
.P
Using a single "-q" option changes the output to look like:
.P
.RS
.PD 0
foobar.1.zip
.P
foobar.0.zip
.RE
.PD
.RE
.TP
\fB-e\fR, \fB--experiment\fR=\fIPID\fR/\fIEID\fR
Specify the experiment(s) to operate on.  If multiple
.B -e
options are given, the action will apply to all of them.  This option overrides
the default behavior of inferring the experiment from the current directory
(see the ENVIRONMENT section).
.TP
\fB-a\fR, \fB--all
Perform the action on all existing experiments that you have created.
.TP
\fB-s\fR, \fB--server\fR=\fISERVER
Specify the XML-RPC server to contact for information about the experiment.
Normal users should not have to use this option.
.TP
\fB-P\fR, \fB--port\fR=\fIPORT
Specify the XML-RPC server port to contact for information about the
experiment.  Normal users should not have to use this option.
.P
.SH SYNC
The
.B sync
action is used to synchronize the logholes on the nodes with the experiment's
log directory on the Emulab users machine.  The action will iterate through
each node in the experiment and perform an rsync(1) on the loghole directories
for that node.  Currently, the only directories synced are "/var/emulab/logs"
Timothy Stack's avatar
 
Timothy Stack committed
202 203 204
and "/local/logs".  In addition, if any of the network links in the experiment
are being traced, the utility will create a directory for each link and setup
symbolic links to the pcap(3) files retrieved from the delay nodes.
Timothy Stack's avatar
 
Timothy Stack committed
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
.P
Optional arguments:
.TP
.I node1 ...
Specify a subset of virtual or physical nodes that should be synchronized,
otherwise all of the nodes will be synchronized.
.SH ARCHIVE
The
.B archive
action is used to archive the logs in an experiment's log directory for future
reference.  The action will produce a standard zip archive with the logs and
some metadata about the experiment and when it can be garbage collected.
.P
Available options:
.TP
\fB-k\fR, \fB--keep-until\fR=(\fIi-delete\fR|\fIspace-is-needed\fR)
Keep the archive until you decide to delete it manually or space is needed.
See the GC section later in the manual to learn how this option and others
affect garbage collection.  (Default: space-is-needed)
.TP
\fB-a\fR, \fB--keep-atleast\fR=\fIN
Keep the archive atleast
.I N
days after creation.  This value keeps the archive from being garbage collected
when more space is needed for atleast the given number of days.  (Default: 3
days)
.TP
\fB-c\fR, \fB--comment\fR=\fICOMMENT
Add a comment to the archive.  This option can be used multiple times to add
more than one comment to the archive.  The comments will be displayed by the
.I show
action and can be useful for storing information about the experiment, for
example, the input parameters.  If the argument to this option is is a single
dash (\fB-\fR) the comment will be read from standard in.
.TP
\fB-d\fR, \fB--delete
241 242 243 244 245 246
After creating the archive, mark the experiment as
.I clean-on-sync
so that any stale data is cleaned out before performing the next
.B sync
operation.  Currently, the mark is a file named ".cleanonsync" in the
experiment log directory.
Timothy Stack's avatar
 
Timothy Stack committed
247 248 249 250 251 252 253 254 255
.SH CHANGE
The
.B change
action is used to change the metadata of an existing archive.  For example, if
after analyzing the log files, you decide that they represent "good" data, you
can add a comment stating that fact and mark the archive as not garbage
collectable.  The action takes the same set of options as the
.B archive
action.
Timothy Stack's avatar
 
Timothy Stack committed
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
.SH LIST
The
.B list
action is used to get a brief summary of all of the log archives found in an
experiment's log directory.  The listing displays the archive name, when it was
created, and its GC status so you can get an idea of when the experiment runs
were performed and what will be garbage collected.
.TP
.B -O
Only list archives that are marked as 'keep until "i-delete"'.
.TP
.B -1
Only list archives that are a day from their keep-atleast date.
.TP
.B -!
Only list archives that are past their keep-atleast date.
.TP
.B -X
Only list archives that are ready to be garbage collected.
.TP
.B -o
List archives that do not match the above flags.  In other words, archives that
will not be deleted at the next garbage collection and are more than a day away
from their keep-atleast dates.
.TP
\fB-m\fR, \fB--keep-atmost\fR=\fIN
Specify how many archives should be kept in the experiment.  This setting
effects what files will be garbage collected, so you should pass this same
option to the
.B gc
if you use a different value from the default of 100 archives.
.TP
\fB-s\fR, \fB--keep-size\fR=\fImegabytes
Specify the maximum total size, in megabytes, for all of the archives in the
experiment.  This setting effects what files will be garbage collected, so you
pass this same option to the
.B gc
if you use a different value from the default of 3MB.
.SH SHOW
The
.B show
action provides a more detailed listing of the log archives for an experiment.
The listing contains information about when and who created the archive, any
attributes used when computing the GC status of the archive, comments attached
to the archive, and a listing of the files in the archive.
.P
Optional arguments:
.TP
.I archive-name
The full or partial name of the archive to display.  If a partial name is
given, any archive names that start with the argument are displayed.  The
default behavior is to display all of the archives in an experiment.
Timothy Stack's avatar
 
Timothy Stack committed
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
.SH CLEAN
The
.B clean
action is used to clean out log files from the experiment's log directory and
the log directories on the nodes.  The default action is to ask confirmation
and then clean out all of the log files.
.P
Available
.B clean
options:
.TP
\fB-f\fR, \fB--force
Do not prompt for confirmation.
.TP
\fB-n\fR, \fB--nodes
Only remove log files on the nodes.
.TP
\fB-e\fR, \fB--experiment
Only remove log directories in the experiment's log directory.
Timothy Stack's avatar
 
Timothy Stack committed
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
.SH GC
The
.B gc
action is used to garbage collect any archives in order to free up space or
reduce the total number of archives in an experiment.  The process for
selecting files to be garbage collected is as follows:
.TP
1.
If the total number of archives and their total size are below the values
specified by the
.B --keep-atmost
and
.B --keep-size
options then no archives will be deleted, otherwise...
.TP
2.
Any files that are marked as 'keep until "space-is-needed"' and past their
"keep-atleast" dates, will be deleted until the keep-atmost and keep-size
conditions are met.  If deleting these files does not meet these conditions
then...
.TP
3.
The oldest files that are marked 'keep until "space-is-needed"' will be deleted
until the keep-atmost and keep-size conditions are met or there are no more
files that can be deleted without user intervention.
.P
Available
.B gc
options:
.TP
\fB-m\fR, \fB--keep-atmost\fR=\fIN
Specify how many archives should be kept in the experiment.  (Default: 100
archives)
.TP
\fB-s\fR, \fB--keep-size\fR=\fImegabytes
Specify the maximum total size, in megabytes, for all of the archives in the
experiment.  (Default: 3.0 MB)
.SH ENVIRONMENT
By default, the project and experiment ID will be inferred from the current
working directory, if it is inside the experiment's directory
Timothy Stack's avatar
 
Timothy Stack committed
367
(i.e. /proj/\fIpid\fR/exp/\fIeid\fR).  This behavior can be overridden using
Timothy Stack's avatar
 
Timothy Stack committed
368 369 370 371 372
the
.B -e
option.
.SH RETURN VALUES
.TP
Timothy Stack's avatar
 
Timothy Stack committed
373 374 375
3
If rsync reports an error.
.TP
Timothy Stack's avatar
 
Timothy Stack committed
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
2
If there was an error processing the command line arguments.
.TP
0
If the action was completed successfully.
.SH EXAMPLES
.PP
To synchronize the log directory for experiment "neptune/myexp" with the log
holes on the experimental nodes.
.PP
.RS
[vmars@users ~] loghole -e neptune/myexp sync
.RE
.PP
To archive the newly recovered logs and print out just the name of the new log
file:
.PP
.RS
[vmars@users ~] loghole -e neptune/myexp -q archive
.RE
.SH FILES
.TP
/proj/\fIpid\fR/exp/\fIeid\fR/logs
The log directory for an experiment.
Timothy Stack's avatar
 
Timothy Stack committed
400
.TP
Timothy Stack's avatar
 
Timothy Stack committed
401 402 403 404 405 406 407 408
/proj/\fIpid\fR/exp/\fIeid\fR/logs/\fInode
The log directory for a node in the experiment.
.TP
/proj/\fIpid\fR/exp/\fIeid\fR/logs/\fIlink
The log directory for a traced LAN or link.  The symbolic links in these
directories refer to the pcap(3) files for a node connected to this LAN or
link.
.TP
Timothy Stack's avatar
 
Timothy Stack committed
409 410 411 412 413 414 415 416
/local/logs
One of the log directories on experimental nodes that is automatically sync'd.
Users should place any logs/data they want transferred back in this directory.
.TP
/var/emulab/logs
Another log directory on experimental nodes that is automatically sync'd.  This
directory usually holds logs generated by the Emulab software running on the
node.
Timothy Stack's avatar
 
Timothy Stack committed
417
.SH SEE ALSO
Timothy Stack's avatar
 
Timothy Stack committed
418
event-sched(8), tevc(1), zip(1), rsync(1), pcap(3)
Timothy Stack's avatar
 
Timothy Stack committed
419 420 421 422 423
.SH AUTHOR
The Emulab project at the University of Utah.
.SH NOTES
The Emulab project can be found on the web at
.IR http://www.emulab.net