xref: /freebsd/sbin/savecore/savecore.8 (revision afe61c15161c324a7af299a9b8457aba5afc92db)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)savecore.8	8.1 (Berkeley) 6/5/93
33.\"
34.Dd June 5, 1993
35.Dt SAVECORE 8
36.Os BSD 4
37.Sh NAME
38.Nm savecore
39.Nd "save a core dump of the operating system"
40.Sh SYNOPSIS
41.Nm savecore
42.Fl c
43.Nm savecore
44.Op Fl fvz
45.Op Fl N Ar system
46.Ar directory
47.Sh DESCRIPTION
48.Nm Savecore
49copies the currently running kernel and its associated core dump into
50.Fa directory ,
51and enters a reboot message and information about the core dump into
52the system log.
53.Pp
54The options are as follows:
55.Bl -tag -width directory
56.It Fl c
57Clears the dump, so that future invocations of
58.Nm savecore
59will ignore it.
60.It Fl f
61Forces a dump to be taken even if the dump doesn't appear correct or there
62is insufficient disk space.
63.It Fl N
64Use
65.Ar system
66as the kernel instead of the default ``/vmunix''.
67.It Fl v
68Prints out some additional debugging information.
69.It Fl z
70Compresses the core dump and kernel (see
71.Xr compress 1 ).
72.El
73.Pp
74.Nm Savecore
75checks the core dump in various ways to make sure that it is current and
76that it corresponds to the currently running system.
77If it passes these checks, it saves the core image in
78.Ar directory Ns Pa /vmcore.#
79and the system in
80.Ar directory Ns Pa /vmunix.#
81The ``#'' is the number from the first line of the file
82.Ar directory Ns Pa /bounds ,
83and it is incremented and stored back into the file each time
84.Nm savecore
85successfully runs.
86.Pp
87.Nm Savecore
88also checks the available disk space before attempting to make the copies.
89If there is insufficient disk space in the filesystem containing
90.Ar directory ,
91or if the file
92.Ar directory Ns Pa /minfree
93exists and the number of free kilobytes (for non-superusers) in the
94filesystem after the copies were made would be less than the number
95in the first line of this file, the copies are not attempted.
96.Pp
97If
98.Nm savecore
99successfully copies the kernel and the core dump, the core dump is cleared
100so that future invocations of
101.Nm savecore
102will ignore it.
103.Pp
104.Nm Savecore
105is meant to be called near the end of the initialization file
106.Pa /etc/rc
107(see
108.Xr rc 8 ) .
109.Sh FILES
110.Bl -tag -width /vmunixxx -compact
111.It Pa /vmunix
112current
113.Tn UNIX
114.El
115.Sh BUGS
116The minfree code does not consider the effect of compression.
117.Sh SEE ALSO
118.Xr compress 1 ,
119.Xr syslogd 8
120.Sh HISTORY
121The
122.Nm
123command appeared in
124.Bx 4.1 .
125