Backing up
- Note that the first time you use a save directory (repository), you'll need --init-savedir.
- Below are 7 examples of backshift backups, from simple to relatively complex:
- To back up / with a pretty accurate progress report. This one is based on the lengths of files (--progress-report full+poststat is default):
- find / -xdev -print0 | backshift --save-directory /where/ever/save-directory --backup --subset slash --init-savedir
- Back up your root filesystem (absent ZFS, which breaks find's -xdev), with less-precise, file-count-based progress, creating
the repository if it does not yet exist:
- find / -xdev -print0 | backshift --save-directory /where/ever/save-directory --backup --subset slash --init-savedir --progress-mode moderate
- To back up / with a pretty accurate progress report (assumes your find
supports -printf). This one is again based on the lengths of files, however it's faster than the example without --progress-report,
especially on large collections of many small files:
- find / -xdev -printf '%s %p\0' | backshift --save-directory /where/ever/save-directory --backup --subset slash --init-savedir --progress-report full+prestat
- To back up / with a minimal progress report - this one does not do a big inhale of filenames at the beginning:
- find / -xdev -print0 | backshift --save-directory /where/ever/save-directory --backup --subset slash --init-savedir --progress-report minimal
- To back up / with no progress report at all - this one is usually best in cron jobs:
- find / -xdev -print0 | backshift --save-directory /where/ever/save-directory --backup --subset slash --init-savedir --progress-report none
- This one backs up /movie with a progress report, keeping the progress report pretty accurate despite a previous incomplete backup
by using randomize --preserve-directories. Note that this example splits one logical line into multiple physical lines in the manner
of POSIX shells and *csh, by using backslashes on all but the last line:
- find /movie -xdev -print0 | \
- ~/src/home-svn/backshift/trunk/randomize -0 -v --preserve-directories --skip-size | \
- /usr/local/pypy-1.4.1/bin/pypy ~/src/home-svn/backshift/tags/0.94/backshift \
- --backup \
- --save-directory /mnt/backshift-incremental-test/save-directory \
- --subset movie
- To pull from an sshfs (sshfs flattens filesystems into a single filesystem) to a local filesystem
(but writing to a remote filesystem is faster than
reading from one - if you have the choice), not creating the savedir (note that backing up a ZFS could be done similarly):
- cd /ssh/fs/base
- find . -xdev \( \( \
- -path ./sys -o \
- -path ./dev -o \
- -path ./var/run -o \
- -path ./var/lock -o \
- -name .gvfs \) -prune -o -print0 \) | \
- backshift --save-directory /where/ever/save-directory --backup --subset fullsave