no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | backup [2012/10/16 22:32] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ======= Simple backupscript utilizing rsync and hardlinks ======= | ||
| + | ===== Synopsis ====== | ||
| + | |||
| + | Backup remote machines using ssh and rsync, utilizing hardlinks for files that has not changed since last backup | ||
| + | |||
| + | ===== Configuration ===== | ||
| + | |||
| + | < | ||
| + | BACKUPUSER=backup | ||
| + | BASEDIR=/ | ||
| + | CONFDIR=/ | ||
| + | DIR="/ | ||
| + | </ | ||
| + | |||
| + | ^ setting ^ description ^ | ||
| + | | backupuser | is the user rsync users to connect to the remote machine, change this to the user you want to use | | ||
| + | | basedir | is the directory your backups are stored in. A file hieracy will be created here / | ||
| + | | confdir | is the directory with local configuration files (excludes and per-host configuration) | | ||
| + | | dir | default directories to backup - this can be changed on a per-host or hostgroup basis | | ||
| + | |||
| + | For per-host configuration you need to create '' | ||
| + | |||
| + | This file needs a host_conf function which will be called with the hostname as an option | ||
| + | backup script will run fine without this initial configuration | ||
| + | |||
| + | example: | ||
| + | < | ||
| + | host_conf() | ||
| + | { | ||
| + | case ${1} in | ||
| + | web*) | ||
| + | DIR=" | ||
| + | HOSTGROUP=" | ||
| + | ;; | ||
| + | esac | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Furthermore the system looks for exclude files named: '' | ||
| + | |||
| + | using the above example and a hostname of '' | ||
| + | |||
| + | < | ||
| + | exclude.default | ||
| + | exclude.web01.example.org | ||
| + | exclude.web | ||
| + | exclude.freebsd | ||
| + | exclude.denmark | ||
| + | </ | ||
| + | |||
| + | note: if you specify DEFAULT_EXCLUDE=0 for a host, '' | ||
| + | |||
| + | These files need to hold regex or fullname of files to exclude | ||
| + | example: | ||
| + | < | ||
| + | *.zip | ||
| + | *.t[gb]z | ||
| + | *.flv | ||
| + | </ | ||
| + | |||
| + | or look at my example files: hostconf.sh exclude.default exclude.web exclude.mysql | ||
| + | Hint: you can use zfs (or another file system with compression enabled) to have your easily compressed files etc compressed on-the-fly | ||
| + | |||
| + | ===== Syntax ===== | ||
| + | |||
| + | < | ||
| + | $path/ | ||
| + | </ | ||
| + | |||
| + | ===== Download ===== | ||
| + | |||
| + | Latest version 1.1 {{files: | ||
| + | |||
| + | ===== Changelog ===== | ||
| + | === 1.1 === | ||
| + | o Initial public release | ||
| + | o Hostgroup capability added | ||
| + | === 1.0 === | ||
| + | o unreleased initial version | ||