table of contents
RDUP-BACKUPS(7) | rdup | RDUP-BACKUPS(7) |
NAME¶
rdup-backups - introduction into making backups with rdupINTRODUCTION¶
rdup is a simple program that prints out a list of files and directories that are changed changed on a filesystem. It is more sophisticated than for instance find, because rdup will find files that are removed or directories that are renamed.- rdup
- With rdup you create the file list on which later
programs in the pipeline can work. The default output format also includes
the files' content. rdup can be seen as a tar replacement in this
respect, but rdup also allows for all kinds of transformations of
the content (encryption, compression, reversal), see the -P switch in
rdup(1) for more information.
- rdup-tr
- With rdup-tr you can transform the files rdup
delivers to you. You can create tar, cpio or pax files. You can encrypt
pathnames. rdup-tr is filter that reads from standard input and
writes to standard output. See rdup-tr(1) for more information. With
rdup and rdup-tr you can create an encrypted archive which
is put in a directory structure that is also encrypted.
- rdup-up
- With rdup-up you can update an existing directory
structure with the updates as described by rdup.
create filelist | transform | update filesystem
( rdup | rdup-tr | rdup-up )
- Note 1:
- The same sequence is used for restoring. In both cases you
want to move files from location A to B. The only difference is that the
transformation is reversed when you restore.
- Note 2:
- The use of rdup-tr is optional.
BACKUPS AND RESTORES¶
For rdup there is no difference between backups and restores. If you think about this for a minute you understand why.BACKUPS¶
It is always best to backup to another medium, be it a different local harddisk or a NFS/CIFS mounted filesystem. You can also use ssh to store file on a remote server, ala rsync (although not as network efficient).SNAPSHOT BACKUPS¶
We need a little help here in the form of the rdup-simple script. Keep in mind that the following scripts can also be run remotely with the help of ssh.#!/bin/bash # some tmp files are saved in ~/.rdup. This directory must exist DIR=/home # what to backup BACKUP=/vol/backup TODAY=$(date +%Y%m/%d) LIST=~/.rdup/list-$HOSTNAME STAMP=~/.rdup/timestamp-$HOSTNAME # for remote backup, this has to run on the remote host! BUGBUG RET=$? case $RET in 2|*) echo Error >&2 exit 1 ;; 1) # full dump, remove file-list and time-stamp file rm $LIST $STAMP ;; 0) # inc dump # do nothing here ;; esac # this is the place where you want to modify the command line # right now, nothing is translated we just use 'cat' rdup -N $STAMP -Pcat $LIST $DIR | rdup-up $BACKUP/$HOSTNAME/$TODAY # or do a remote backup #rdup -N $STAMP -Pcat $LIST $DIR | ssh root@remotehost \ # rdup-up $BACKUP/$HOSTNAME/$TODAY
LOCAL BACKUPS¶
With rdup-simple you can easily create backups. Backing up my home directory to a backup directory:rdup-simple ~ /vol/backup/$HOSTNAME
rdup-simple ~ /etc/ /var/lib
/vol/backup/$HOSTNAME
rdup-simple -z ~ /etc/ /var/lib
/vol/backup/$HOSTNAME
REMOTE BACKUPS¶
For a remote backup to work, both the sending machine and the receiving machine must have rdup installed. The currently implemented protocol is ssh.rdup-simple ~
ssh://miekg@remote/vol/backup/$HOSTNAME
rdup-simple -z -k 'secret-file' ~
ssh://miekg@remote/vol/backup/$HOSTNAME
ALSO SEE¶
rdup(1), rdup-tr(1), rdup-up(1) and http://www.miek.nl/projects/rdup/15 Dec 2008 | 1.1.x |