View | Details | Raw Unified | Return to bug 21093
Collapse All | Expand All

(-)/usr/src/sbin/restore/main.c (-7 / +14 lines)
Lines 52-57 Link Here
52
#include <protocols/dumprestore.h>
52
#include <protocols/dumprestore.h>
53
53
54
#include <err.h>
54
#include <err.h>
55
#include <errno.h>
55
#include <stdio.h>
56
#include <stdio.h>
56
#include <stdlib.h>
57
#include <stdlib.h>
57
#include <unistd.h>
58
#include <unistd.h>
Lines 99-107 Link Here
99
		inputdev = _PATH_DEFTAPE;
100
		inputdev = _PATH_DEFTAPE;
100
	obsolete(&argc, &argv);
101
	obsolete(&argc, &argv);
101
#ifdef KERBEROS
102
#ifdef KERBEROS
102
#define	optlist "b:cdf:hikmNRrs:tuvxy"
103
#define	optlist "b:cD:df:hikmNRrs:tuvxy"
103
#else
104
#else
104
#define	optlist "b:cdf:himNRrs:tuvxy"
105
#define	optlist "b:cD:df:himNRrs:tuvxy"
105
#endif
106
#endif
106
	while ((ch = getopt(argc, argv, optlist)) != -1)
107
	while ((ch = getopt(argc, argv, optlist)) != -1)
107
		switch(ch) {
108
		switch(ch) {
Lines 117-122 Link Here
117
		case 'c':
118
		case 'c':
118
			cvtflag = 1;
119
			cvtflag = 1;
119
			break;
120
			break;
121
		case 'D':
122
			if (chdir(optarg) < 0)
123
				errx(1,
124
				     "error accessing file system %s; %s",
125
				     optarg, strerror(errno));
126
			break;
120
		case 'd':
127
		case 'd':
121
			dflag = 1;
128
			dflag = 1;
122
			break;
129
			break;
Lines 293-303 Link Here
293
usage()
300
usage()
294
{
301
{
295
	(void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n",
302
	(void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n",
296
	  "restore -i [-chkmuvy] [-b blocksize] [-f file] [-s fileno]",
303
	  "restore -i [-chkmuvy] [-b blocksize] [-D path] [-f file] [-s fileno]",
297
	  "restore -r [-ckuvy] [-b blocksize] [-f file] [-s fileno]",
304
	  "restore -r [-ckuvy] [-b blocksize] [-D path] [-f file] [-s fileno]",
298
	  "restore -R [-ckuvy] [-b blocksize] [-f file] [-s fileno]",
305
	  "restore -R [-ckuvy] [-b blocksize] [-D path] [-f file] [-s fileno]",
299
	  "restore -x [-chkmuvy] [-b blocksize] [-f file] [-s fileno] [file ...]",
306
	  "restore -x [-chkmuvy] [-b blocksize] [-D path] [-f file] [-s fileno] [file ...]",
300
	  "restore -t [-chkuvy] [-b blocksize] [-f file] [-s fileno] [file ...]");
307
	  "restore -t [-chkuvy] [-b blocksize] [-D path] [-f file] [-s fileno] [file ...]");
301
	done(1);
308
	done(1);
302
}
309
}
303
310
(-)/usr/src/sbin/restore/restore.8 (+21 lines)
Lines 44-67 Link Here
44
.Fl i
44
.Fl i
45
.Op Fl chkmNuvy
45
.Op Fl chkmNuvy
46
.Op Fl b Ar blocksize
46
.Op Fl b Ar blocksize
47
.Op Fl D Ar path
47
.Op Fl f Ar file
48
.Op Fl f Ar file
48
.Op Fl s Ar fileno
49
.Op Fl s Ar fileno
49
.Nm restore
50
.Nm restore
50
.Fl R
51
.Fl R
51
.Op Fl ckNuvy
52
.Op Fl ckNuvy
52
.Op Fl b Ar blocksize
53
.Op Fl b Ar blocksize
54
.Op Fl D Ar path
53
.Op Fl f Ar file
55
.Op Fl f Ar file
54
.Op Fl s Ar fileno
56
.Op Fl s Ar fileno
55
.Nm restore
57
.Nm restore
56
.Fl r
58
.Fl r
57
.Op Fl ckNuvy
59
.Op Fl ckNuvy
58
.Op Fl b Ar blocksize
60
.Op Fl b Ar blocksize
61
.Op Fl D Ar path
59
.Op Fl f Ar file
62
.Op Fl f Ar file
60
.Op Fl s Ar fileno
63
.Op Fl s Ar fileno
61
.Nm restore
64
.Nm restore
62
.Fl t
65
.Fl t
63
.Op Fl chkNuvy
66
.Op Fl chkNuvy
64
.Op Fl b Ar blocksize
67
.Op Fl b Ar blocksize
68
.Op Fl D Ar path
65
.Op Fl f Ar file
69
.Op Fl f Ar file
66
.Op Fl s Ar fileno
70
.Op Fl s Ar fileno
67
.Op file ...
71
.Op file ...
Lines 69-74 Link Here
69
.Fl x
73
.Fl x
70
.Op Fl chkmNuvy
74
.Op Fl chkmNuvy
71
.Op Fl b Ar blocksize
75
.Op Fl b Ar blocksize
76
.Op Fl D Ar path
72
.Op Fl f Ar file
77
.Op Fl f Ar file
73
.Op Fl s Ar fileno
78
.Op Fl s Ar fileno
74
.Op file ...
79
.Op file ...
Lines 275-280 Link Here
275
.Fl c
280
.Fl c
276
flag disables this check, and only allows reading a dump in the old
281
flag disables this check, and only allows reading a dump in the old
277
format.
282
format.
283
.It Fl D Ar path
284
Specifies the destination path of where to restore the files.
285
Without the
286
.Fl D
287
flag, the files are restored to the current directory.
278
.It Fl f Ar file
288
.It Fl f Ar file
279
Read the backup from
289
Read the backup from
280
.Ar file ;
290
.Ar file ;
Lines 422-427 Link Here
422
owner, mode, and time stamps for directories.
432
owner, mode, and time stamps for directories.
423
.It Pa \&./restoresymtable
433
.It Pa \&./restoresymtable
424
information passed between incremental restores.
434
information passed between incremental restores.
435
.El
436
.Sh EXAMPLES
437
The dump and
438
.Nm restore
439
commands may be used in a pipeline expression to copy file systems.
440
The following are typical commands, both equivalent:
441
.Bd -literal -offset indent
442
dump -0 -a -f - /usr | (cd /mnt; restore -r -f -)
443
dump -0af - /usr | restore -rf - -D /mnt
444
.Ed
445
.Pp
425
.El
446
.El
426
.Sh SEE ALSO
447
.Sh SEE ALSO
427
.Xr dump 8 ,
448
.Xr dump 8 ,

Return to bug 21093