Langue: en

Autres versions - même langue

Version: 27 Nov 2008 (ubuntu - 24/10/10)

Section: 1 (Commandes utilisateur)


rdup-tr - transform rdup output


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


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 -c 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 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 by rdup-tr).

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 rdup-tr 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 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 (for instance) 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). rdup-tr 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 rdup-tr 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 (rdup-tr). 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:

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

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

delete information is lost
hardlink information is lost

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


Filter all output through command, opt0 through opt6 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 no space in between.

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

Select list input format. Normally rdup-tr accepts rdup output, with this option you can give it a list of path names.
Output format. This can be 'tar', 'cpio', 'pax' or 'rdup'. It defaults to 'rdup'.
-X key
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.

-Y key
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.
Force output to the tty. Normally rdup-tr wants to see it's output redirected.
Be more verbose.
Print rdup-tr's version.
A short help.


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 >\

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 >\

Notice the reversal of the -P options.


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


Written by Miek Gieben.


Report bugs to <miek@miek.nl>.


http:/www.miek.nl/projects/rdup/ is the main site of rdup. Also see 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.