rdup-tr

Langue: en

Autres versions - même langue

Version: 27 Nov 2008 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

rdup-tr - transform rdup output

SYNOPSIS

rdup-tr [-Pcmd,opt1,...,opt7]... [OPTION]...

DESCRIPTION

Transform rdup output into something else. Where something else can be a tar, cpio, pax archive or another rdup stream.

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

The output of rdup-tr is a rdup -c stream, i.e. the list of pathnames with the file content (which is possibly transformed).

You can select other types of output (-O flag), but you must be aware that you may loose some information, see the table below.

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

When creating such output you might also want to 'pipe' the contents of each file through a number of commands, say a compression and encryption utility. Note that this is different than compressing the entire archive which can be done by using the -z option of GNU tar. So this is where rdup-tr comes in. It allows you to create a normal archive in which each file is encrypted (or compressed. reversed or whatever).

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.

rdup-tr works by forking off a number of child processes (those commands named with the -P option(s)), interconnecting these with pipes. The output created by these child processes is captured in a temporary file in /tmp. From there the contents it put in an archive, then the file is truncated and the process restarts for the next file. In an ASCII image:


                     stdout
            +----------------------------------> archive
           /  
    rdup-tr     loop #files        <---+
      |                                |
      +-> cmd1 | cmd2 | ...| cmdN > tmpfile

NOTE

When creating an archive out of plain rdup output you will loose the information concerning the files that are to be removed. Only the modified and new files are included in the archive. The output format 'rdup' does not have this limitation.

The following table show what happens with the output depending on the input.

0
OK
D
delete information is lost
H
hardlink information is lost

    output
tar,cpio,pax rdup
input
------------- ------------- ------
rdup D 0
filelist DH H

OPTIONS

-Pcommand,opt1,...,opt7
Filter all output through command, opt1 through opt7 are given as options to the command. Multiple -P can be used, there is however a maximum of five options for each command. The options are separated with commas, there must be no space in between.

Due to the nature of pipes in Unix, this pipeline is recreated for every file processed.

-L
Select list input format. Normally rdup-tr accepts rdup output, with this option you can read a list of path names.
-O
Output format. This can be 'tar', 'cpio', 'pax' or 'rdup'.
-c
Force output to the tty. Normally rdup-tr wants to see it's output redirected.
-v
Be more verbose.
-V
Print rdup-tr's version.
-h
A short help.

EXAMPLES

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,-c,-f\
    -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,-c,-f\
    -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 -Pgzip,-d,-c,-f 

Encryption with openssl


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

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


    rdup /dev/null /home | ./rdup-tr -Pgzip,-c,-f \
    -Popenssl,enc,-e,-des-cbc,-k,secret | gzip -c -f >\
    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-c,-f >\
    my_rdup_archive

Notice the reversal of the -P options.

EXIT CODE

rdup-tr return a zero exit code on success, otherwise 1 is returned.

AUTHOR

Written by Miek Gieben.

REPORTING BUGS

Report bugs to <miek@miek.nl>.

SEE ALSO

http:/www.miek.nl/projects/rdup is the main site of rdup. And rdup(1), rdup-up(1) and rdup-backups(7). Copyright (C) 2005-2009 Miek Gieben. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Licensed under the GPL version 3. See the file LICENSE in the source distribution of rdup.