SNAP(4)SNAP(4)NAME
snap, snapfs - create and mount process snapshots
SYNOPSISsnap [ -o file ] pid...
snapfs [ -a ] [ -m mtpt ] [ -s service ] file...
DESCRIPTION
Snap and snapfs allow one to save and restore (static) process images,
usually for debugging on a different machine or at a different time.
Snap writes a snapshot (see snap(6)) of the named processes to file
(default standard output). If pid is a text string rather than a
process id, snap will save all processes with that name that are owned
by the current user. Both memory and text images are saved.
Snapfs is a file server that recreates the /proc directories for the
processes in the snapshot. By default, it mounts the new directories
into /proc before the current entries. The -m option can be used to
specify an alternate mountpoint, while -a will cause it to mount the
new directories after the current entries. The -s option causes it to
serve requests via /srv/service.
EXAMPLE
Suppose page has hung viewing Postscript on your terminal, but the
author is gone for the rest of the month and you want to make sure the
process is still around for debugging on his return. You can save the
errant processes with
snap-o page.snap `{psu | awk '$NF ~ /page|gs/ {print $2}'}
When the author returns, he can add the process images to his name
space by running
snapfs page.snap
and then use a conventional debugger to debug them.
SOURCE
/sys/src/cmd/snap
SEE ALSOacid(1), db(1), proc(3), snap(6)BUGS
The snapshots take up about as much disk space as the processes they
contain did memory. Compressing them when not in use is recommended,
as is storing them on a rewritable disk.
Pid as a non-numeric string is unimplemented; it has to be a number.
SNAP(4)