Commit Graph

59 Commits

Author SHA1 Message Date
christos 64747563b4 sprinkle const 2005-06-27 01:37:32 +00:00
hannken 1f51c28099 Snapshot support for dump(8):
- New option `-x backup' takes the dump from a snapshot backed up by `backup'.
  The snapshot will be deleted on exit.

- New option `-X' as a synonym for `-x mountpoint' where `mountpoint' is the
  file system to be dumped.

Reviewed and Approved by: Manuel Bouyer <bouyer@netbsd.org>
2005-04-19 07:26:38 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
agc bf07c8719a Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:11 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
lukem ec029d0aa9 Use "wall -g operator" (instead of private code) to broadcast() messages to
members of the operator group.
Don't install "setgid tty", and remove now unnecessary gid/egid swapping.
Remove utmp trawling code pulled in from usr.bin/who.
The Code is now simpler, and more portable (without the utmp cruft) too.

This is derived from similar work in OpenBSD.
2003-03-27 13:56:46 +00:00
itojun bc0b132907 should be safer to cast to u_long than to cast down to int 2002-11-17 04:49:18 +00:00
tsutsui b2c857ac58 Add a cast to sizeof in printf() arg since _BSD_SIZE_T is unsigned long
on some ports.
2002-11-17 04:44:42 +00:00
itojun 94ccb14a99 use strlcpy. use sizeof() instead of xxLEN to avoid de-synchronization 2002-11-16 14:15:35 +00:00
bouyer cf39881866 For -l: specify the timeout on the command line (in seconds) instead of
hardwiring it to 2s, as suggested on tech-userlevel.
2002-01-07 17:34:08 +00:00
lukem 9dcaec9cca Add -a to "auto-size" the tape, rather than relying upon other options
to define the tape size.  Requires the tape driver to either return ENOSPC
at end of media, or 0 when a write is attempted (such as the "early warning"
support in st(4) enabled with "mt eew 1").   From FreeBSD.
2001-12-30 04:03:16 +00:00
lukem 8975510a51 Fixes from FreeBSD:
- Fix error if first tape was write protected.  Fix NetBSD PRs 4754 and 6098.
- Make dump exit codes confirm to manual page.
- Use \a instead of \7 to make noise.
- Fix estimated number of tapes for huge dumps to cartridges.
- Use <sys/queue.h> SLIST_* instead of home-rolled lists.
- Do not exit if unable to read or create /etc/dumpdates.
- Support output (tape) device returning ENOSPC for end-of-media on a write.

Fixes by me:
- Remove unused ddates_in.
- Don't dump core if SIGINFO is received before 1 second has elapsed.
- Only process SIGINFO in current "active" child.
- Don't dump core in -w if dumpdates wasn't readable and ddatev == NULL
- Minor KNF; wrap some lines
2001-12-25 12:06:26 +00:00
lukem b73cca7b92 clean up from time_t -> int32_t change in dumprestore.h 2001-12-23 14:42:22 +00:00
lukem 1ab8ecafe7 unifdef sunos 2001-12-23 12:54:53 +00:00
lukem b734f790f5 nuke trailing whitespace 2001-12-23 12:29:55 +00:00
lukem 4720d32cfe - use correct type for minTime in findlru() (size_t instead of int)
- clean up whitespace
2001-12-22 08:05:24 +00:00
soren 11c2f93975 Another little mistake, spotted by wiz. 2001-12-20 20:20:38 +00:00
soren dc53bf3cba Sync getopt() / man page with actual getopt options. 2001-12-20 20:10:33 +00:00
bouyer 740dbf0d62 Add a -l (autoload) flag. For multivolume dumps, this makes dump eject the
tape when a volume is full, and try to reopen the tape drive for 2 mn.
To be used with tape changers which load the next tape when the current one is
ejected.
While I'm there fix eject handling for remote tape.
2001-12-14 14:43:33 +00:00
lukem 29d31edd5f relax the restriction on -F that the file system image argument must be a
regular file
2001-11-16 04:41:23 +00:00
blymn a152a6a92a Add the capability for dump to print timestamps on all informational
messages.
2001-10-15 13:25:33 +00:00
lukem b1a3e1140e - implement -F, which indicates that files-to-dump is a regular file
containing a file system image (instead of being a single file as
  part of a subtree dump)
- use "file system" instead of "filesystem" or "file-system"
2001-08-14 06:51:36 +00:00
david a84be23c10 Patch to drop setgid tty privs until forking for operator notification 2001-08-08 16:49:54 +00:00
mrg d699caad5a reset uid & gid around calling rmthost(). 2001-07-17 10:56:53 +00:00
mrg 5c897ed92f display what signal, not "unknown" 2001-07-16 13:30:13 +00:00
hannken de85f7e43e Assign a saved copy of dt->fs_file to mountpoint. dt->fs_file will be freed
otherwise resulting in a wrong spcl.c_filesys .
2001-06-03 09:51:10 +00:00
lukem 9af1692ef1 * improve parsing of file-systems-to-dump when a path is given:
- if it's a path to an unmounted file-system listed in /etc/fstab, use
	that instead of assuming the user wanted a subtree dump of the parent
	directory. this restores the behaviour of dump before the subtree
	dumping code went in.
      - if it's a path to a mounted file-system which is not in /etc/fstab,
	use the info from getmntinfo(3). previously, dump would choke.
* implement error checked malloc(), calloc(), strdup(), and use
  appropriately (some of the calloc()s weren't being checked)
* use 'file-system' instead of 'filesystem' in the man page
2001-05-28 01:09:54 +00:00
lukem 713ffa0ec4 more KNF 2001-05-27 15:07:34 +00:00
lukem 99feaf5b29 knf to ansi 2001-05-27 14:17:56 +00:00
tron b82fe09a8d Add "e" option to usage message. Problem pointed out by Takahiro Kambe
in private e-mail.
2001-05-12 10:26:22 +00:00
tron b72a1f53d6 Fix bug in new "e" option: only eject tape if it is full, not if the dump
was finished.
2001-05-12 08:03:01 +00:00
tron d6be44d3c8 Add a new option "e" to "dump" which allows to eject tapes automatically
if a tape change is required.
2001-05-07 21:17:48 +00:00
scw e89e2124d1 Global variables don't need to be initialised to zero. 2000-12-13 22:45:12 +00:00
briggs 1e8e167a26 Fix format warnings 2000-10-11 04:57:42 +00:00
perseant 2763cc1921 Working version of aborted dump{,_lfs} join. 1999-10-01 04:35:21 +00:00
perseant e8247b4092 Back out changes made on the 29th, not at all the changes I intended to commit.
(I don't know how I did it though ... I'll figure it out tonight.)
I'll reapply this, in a working form, this evening.
1999-09-30 20:39:58 +00:00
perseant 54fd3dd508 Adapt dump(8) to use filestore-independent (but still ufs-specific)
replacements for NINDIR, fsbtodb, etc.  Create dump_lfs by adding a few
LFS-filestore-specific routines.  As described in PR#8317.
1999-09-29 04:57:48 +00:00
bouyer 491d912f59 Implement a read cache, as announced on tech-userlevel. Default is 32k
read buffer size, 512 buffer or 15% of the user memory. Can be changed
with the -k and -s options.
1999-03-23 14:22:59 +00:00
lukem 2faa2d1ff5 add support for '-L label', which file(1) and restore(1) can extract from the
header. mostly based on [bin/6715] from Brian Grayson <bgrayson@ece.utexas.edu>

old filesystems don't have fs_qbmask and fs_qfmask set in the superblock;
fudge them as per code in /sys/ufs/ffs/ffs_vfsops.c::ffs_oldfscompat().
bug and suggested fix from Robert Elz <kre@munnari.OZ.AU> in [bin/6610]
    XXX: there may be other variables required as well...
1999-01-03 02:17:46 +00:00
ross 029a64cc29 from Erik Bertelsen <erik@mediator.uni-c.dk>
{ put } { in } { lots } { of } { these } { to } { shut } { up } { egcs }
1998-08-25 19:18:12 +00:00
mrg 2beab49a06 - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:45:41 +00:00
bouyer 34ccbd430c Add support for non-native byte order FFS. The dump is in filesystem byte
order, restore already knows how to byteswap dumps.
1998-03-18 16:54:56 +00:00
lukem 865fe3908e Various changes from Brian Grayson <bgrayson@ece.utexas.edu> in [bin/4103]
* exit after providing an estimate if -S was given. the PR used -e,
  but checking around indicated prior art in Solaris usin -S.
* remove superfluous 'DUMP:' prefix in two messages
* initialise blocksperfile explicitly (not necessary, but everything
  else in that section gets initialised, so be consistant :)
* display the ``pretty'' name of the dumped directory, so the user
  knows if it's a subset or not
1997-09-18 03:03:55 +00:00
lukem 919c9246d4 resolve conflicts from lite-2 import 1997-09-16 06:41:19 +00:00
lukem a84bab531d * cleanup for WARNS=1
* fix use of .Nm
* comment out some unused(?) functions
1997-09-15 07:58:01 +00:00
lukem 4c54f5b742 * Add the ability to dump specific files & directories of a single
filesystem. This uses fts(3) to access the directory structure (and
  not the raw device), so the standard access permissions are adhered
  to (unlike dumping an entire filesystem, which just requires read
  access to the raw disk device).
* Support SIGINFO status reporting.
* Remove now unused variables that previously stored the (e)uid.
* Be more informative in a couple of error messages.
1997-06-05 11:13:18 +00:00
mrg 88c38b1d8c enable rcmd(). garbage collect. 1997-05-27 08:35:25 +00:00
mrg d655665117 be safe with buffers. 1997-04-21 11:31:15 +00:00
lukem 93da79de2b remove use of "register". 1997-04-15 01:09:49 +00:00
lukem 578deb45c4 Implement changes from [bin/1915]
* 'w' and 'W' display the year
* verbosity additions displaying total & per-volume transfer times and rates
1997-04-10 05:36:23 +00:00