File: rdup-tr.1.in

package info (click to toggle)
rdup 1.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,996 kB
  • ctags: 185
  • sloc: ansic: 3,326; sh: 3,221; exp: 166; makefile: 64
file content (207 lines) | stat: -rw-r--r-- 6,545 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
'\" t
.TH RDUP-TR 1 "27 Nov 2008" "@PACKAGE_VERSION@" "@PACKAGE_NAME@"
.SH NAME
@PACKAGE_NAME@-tr \- transform rdup output
.SH SYNOPSIS
.B @PACKAGE_NAME@-tr
[\fI\-Pcmd,opt1,...,opt7\fR]...
[\fIOPTION\fR]...

.SH DESCRIPTION
Transform rdup output into something else. Where something else can
be a tar, cpio, pax archive or another rdup stream (An rdup stream
is rdup \fI\-c\fR output).

The default is reading a normal rdup file list and writing rdup streams.
Thus the input
expected is the normal rdup output, i.e. the list of pathnames
and some extra information, but \fIno\fR file content.

The output of \fBrdup-tr\fR is a \fBrdup \fI\-c\fR stream, i.e. the list
of pathnames \fIwith\fR the file content (which is possibly 
transformed by \fBrdup-tr\fR).

You can select other types of output (\-O flag), but you must be aware
that you may loose some information in formats other than rdup's own, see 
the table below.

You may also supply \fBrdup-tr\fR with only a list of pathnames, this can 
be selected with the \-L flag. 

When creating output you might also want to 'pipe' the contents
of \fIeach\fR file through a number of commands, say a compression and 
encryption utility. Note that this is different than compressing the
\fIentire\fR archive which can be done (for instance) by using the \-z option of
GNU tar. So this is where \fBrdup-tr\fR comes in. It allows you to create
a normal archive in which \fIeach\fR file is encrypted (or compressed.
reversed or whatever). \fBrdup-tr\fR does this by forking child
processes which transform the contents.

If one of
the forked children returns an exit code other than zero (0), it
is assumed the whole conversion process failed. In that case the
original file content is printed as-is.

This command combines all previously written rdup-utils
(rdup-gzip, rdup-crypt, rdup-gpg, etc) into a single executable, making
it much more maintainable. And allowing for cool new features, see \-X 
(path encryption) for instance.

As said \fBrdup-tr\fR works by forking off a number of child processes (those
commands named with the \-P option(s)), interconnecting these
with pipes. The current file is connected to the first child.
The output created by these child processes is
captured by the parent (\fBrdup-tr\fR).
The contents is then written to standard output in an archive format. As a picture says more
than a thousand words here is an ASCII image:

.RS
                    
            +--- ...   (stdout)    ... ----> archive
           /  
    rdup-tr  <--- ...   ... <----+
                                 |
   loop #files                   |
                                 |
  file ---> cmd1 | cmd2 | ...| cmdN

.RE

The following table shows what happens with the output
depending on the input. 
.BR
.TP 
.B 0
OK
.TP 
.B D
delete information is lost
.TP 
.B H
hardlink information is lost
.BR

.TS
L|L|CC.
    output	tar,cpio,pax	rdup
input	    
-------------	-------------	------
rdup	    D	0
filelist	    DH	H

.TE

.SH OPTIONS
.TP
.B \-P\fIcommand\fR,\fIopt0\fR,...,\fIopt6\fR
Filter all output through command, \fIopt0\fR through \fIopt6\fR are
given as options to the command. Multiple \-P's can be used, there is
however a maximum of seven options for each command. The options
are separated with commas, there must be \fIno\fR space in between.

Due to the nature of pipes in Unix, this pipeline is recreated for
every file processed.
.TP
.B \-L
Select list input format. Normally \fBrdup-tr\fR accepts rdup output,
with this option you can give it a list of path names.
.TP
.B \-O
Output format. This can be 'tar', 'cpio', 'pax' or 'rdup'. It
defaults to 'rdup'.
.TP
.B \-X \fIkey\fR
Read the encryption key from the file key and encrypt all paths
with AES and this key. After the encryption the binary data is
converted into ascii using an URL safe (Section 4 of RFC 3548)
version of base64 encode.

The encryption key must be on the first line and the key size
must be 16, 24 or 32 bytes. Anything above 32 will be truncated.
.TP
.B \-Y \fIkey\fR
Read the decryption key from the file key and decrypt all paths
with AES and this key. Before the encryption the paths
are converted to binary by using an URL safe version of base64 decode.
.TP
.B \-c
Force output to the tty. Normally \fBrdup-tr\fR wants to see it's
output redirected.
.TP
.B \-v
Be more verbose. 
.TP
.B \-V
Print rdup-tr's version.
.TP
.B \-h
A short help.

.SH EXAMPLES
I have a new favorite pipeline since rdup release 0.9.0

    rdup /dev/null /home | \\
    rdup-tr -Pgzip -Pmcrypt,-fKEY,-c -O tar -Xboe | \\
    gzip > my-home-zipped-crypted-pathcrypted-tar.gz

That is: all files under /home are gzipped and encrypted
on a per file basis. Further more, all pathnames are
AES encrypted. This is put in a tar file, which is then
compressed, resulting in the final output.

Creating a compressed and encrypted tar archive out of a full
rdup dump might be done as follows

    rdup /dev/null /home | rdup-tr -Pgzip\\
    -Pmcrypt,-fKEY,-c -O tar > my-home-zipped-and-crypted.tar

Or even pack and unpack it on the fly

    rdup /dev/null /home | rdup-tr -Pgzip\\
    -Pmcrypt,-fKEY,-c -O tar | ssh user@remotehost tar xvCf /tmp -

When unzipping an "archive", gzip will do the right thing wrt to files
that are not compressed and will just print them as-is. So the following
will work

    rdup /dev/null /home | ./rdup-tr -c -Pgunzip 

Encryption with openssl

    rdup /dev/null /home | ./rdup-tr -c -Popenssl,enc,-e,-des-cbc,-k,secret 

Or, compressing with gzip, encrypting with openssl and then compressing
the entire archive yet again

    rdup /dev/null /home | ./rdup-tr -Pgzip\\
    -Popenssl,enc,-e,-des-cbc,-k,secret | gzip >\\
    my_compressed_encrypted_rdup_archive.gz

Recreating the original rdup (-c) output, which can be fed to rdup-up.

    gunzip -c my_compressed_encrypted_rdup_archive.gz |\\
    rdup-tr -Popenssl,enc,-d,-des-cbc,-k,secret -Pgzip,-d >\\
    my_rdup_archive

Notice the reversal of the \-P options.

.SH EXIT CODE
\fBrdup-tr\fR return a zero exit code on success, otherwise 1 is returned.

.SH AUTHOR
Written by Miek Gieben. 

.SH REPORTING BUGS
Report bugs to <miek@miek.nl>. 

.SH SEE ALSO
http:/www.miek.nl/projects/rdup/ is the main site of rdup. Also see rdup(1),
rdup-up(1) and rdup-backups(7).

.SH COPYRIGHT
Copyright (C) 2005-2009 Miek Gieben. This is free software. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
.PP
Licensed under the GPL version 3. See the file LICENSE in the source distribution
of rdup.