xref: /original-bsd/sbin/savecore/savecore.8 (revision 6093a5ae)
1.\" Copyright (c) 1980, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)savecore.8	6.7 (Berkeley) 07/10/92
7.\"
8.Dd
9.Dt SAVECORE 8
10.Os BSD 4
11.Sh NAME
12.Nm savecore
13.Nd "save a core dump of the operating system"
14.Sh SYNOPSIS
15.Nm savecore
16.Op Fl fv
17.Ar dirname
18.Op Ar system
19.Nm savecore
20.Fl c
21.Sh DESCRIPTION
22.Nm Savecore
23is meant to be called near the end of the initialization file
24.Pa /etc/rc
25(see
26.Xr rc 8 ) .
27Its function
28is to save the core dump of the system (assuming one was made) and to
29write a reboot message in the shutdown log.
30.Pp
31Options supported by
32.Nm savecore :
33.Bl -tag -width dirname
34.It Fl c
35Clears the dump without saving it.
36.It Fl f
37Forces a dump to be taken even if the magic number indicates
38there isn't a dump.
39.It Fl v
40Prints out some extra information.
41.El
42.Pp
43Operands supported by
44.Nm savecore :
45.Bl -tag -width dirname
46.It Ar dirname
47The directory name where the core dump will be written.
48.It Ar system
49If the core dump was from a system other than
50.Pa /vmunix ,
51the name
52of that system must be supplied as
53.Ar system .
54.El
55.Pp
56.Nm Savecore
57checks the core dump to be certain it corresponds with the
58current running unix.  If the core dump is current, it saves the core
59image in
60.Ar dirname Ns Pa /vmcore.n
61and the namelist
62in
63.Ar dirname Ns Pa /vmunix.n
64Sequence numbers are incremented and appended to the end of the pathnames
65each time
66.Nm savecore
67is run in the directory.
68.Pp
69Before savecore writes out a core image, it reads a number from the file
70.Ar dirname Ns Pa /minfree .
71If the number of free kilobytes on the filesystem which contains
72.Ar dirname
73is less than the number obtained from the minfree file,
74the core dump is not saved.
75If the minfree file does not exist, savecore always writes out the core
76file (assuming that a core dump was taken).
77.Pp
78.Nm Savecore
79also logs a reboot message using facility
80.Dv LOG_AUTH
81(see
82.Xr syslog 3 )
83If the system crashed as a result of a panic,
84.Nm savecore
85logs the panic string too.
86.Sh FILES
87.Bl -tag -width /vmunixxx -compact
88.It Pa /vmunix
89current
90.Tn UNIX
91.El
92.Sh BUGS
93Can be fooled into thinking a core dump is the wrong size.
94.Sh HISTORY
95The
96.Nm
97command appeared in
98.Bx 4.1 .
99