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.6 (Berkeley) 03/16/91 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.Ar dirname 17.Op Ar system 18.Sh DESCRIPTION 19.Nm Savecore 20is meant to be called near the end of the initialization file 21.Pa /etc/rc 22(see 23.Xr rc 8 ) . 24Its function 25is to save the core dump of the system (assuming one was made) and to 26write a reboot message in the shutdown log. 27.Pp 28Operands supported by 29.Nm savecore : 30.Bl -tag -width Ar 31.It Ar dirname 32The directory name where the core dump will be written. 33.It Ar system 34If the core dump was from a system other than 35.Pa /vmunix , 36the name 37of that system must be supplied as 38.Ar system . 39.El 40.Pp 41.Nm Savecore 42checks the core dump to be certain it corresponds with the 43current running unix. If the core dump is current, it saves the core 44image in 45.Ar dirname Ns Pa /vmcore.n 46and the namelist 47in 48.Ar dirname Ns Pa /vmunix.n 49Sequence numbers are incremented and appended to the end of the pathnames 50each time 51.Nm savecore 52is run in the directory. 53.Pp 54Before savecore writes out a core image, it reads a number from the file 55.Ar dirname Ns Pa /minfree . 56If the number of free kilobytes on the filesystem which contains 57.Ar dirname 58is less than the number obtained from the minfree file, 59the core dump is not saved. 60If the minfree file does not exist, savecore always writes out the core 61file (assuming that a core dump was taken). 62.Pp 63.Nm Savecore 64also logs a reboot message using facility 65.Dv LOG_AUTH 66(see 67.Xr syslog 3 ) 68If the system crashed as a result of a panic, 69.Nm savecore 70logs the panic string too. 71.Sh FILES 72.Bl -tag -width /vmunixxx -compact 73.It Pa /vmunix 74current 75.Tn UNIX 76.El 77.Sh BUGS 78Can be fooled into thinking a core dump is the wrong size. 79.Sh HISTORY 80The 81.Nm 82command appeared in 83.Bx 4.1 . 84