Line 15: |
Line 15: |
| === Description === | | === Description === |
| | | |
− | rdiff-backup is a backup software | + | rdiff-backup is a backup software. rdiff-backup backs up one directory to another, possibly over a network. The target directory ends up a copy of the source directory, but extra reverse diffs are stored in a special subdirectory of that target directory, so you can still recover files lost some time ago. The idea is to combine the best features of a mirror and an incremental backup. rdiff-backup also preserves subdirectories, hard links, dev files, permissions, uid/gid ownership, modification times, extended attributes, acls, and resource forks. Also, rdiff-backup can operate in a bandwidth efficient manner over a pipe, like rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up to a remote location, and only the differences will be transmitted. Finally, rdiff-backup is easy to use and settings have sensical defaults. See: http://www.nongnu.org/rdiff-backup/ |
| | | |
| | | |
| === Requirements === | | === Requirements === |
− | *SME Server 7.X or 8.X | + | *SME Server 7.X, 8.X or 9.X |
| | | |
| + | === Installation === |
| + | |
| + | yum --enablerepo=smecontribs install smeserver-rdiff-backup |
| | | |
| + | ===Configuration=== |
| + | To get the current configuration: |
| + | sudo /sbin/e-smith/config show rdiff-backup |
| + | this will return something similar to : |
| + | rdiff-backup=service |
| + | EnableLocal=yes |
| + | EnableRemote=no |
| + | Hour=2 |
| + | LocalPath=/media/usbdisk/rdiff-backup |
| + | Minute=8 |
| + | RemoteHost=timtam |
| + | RemoteIdentity=/root/.ssh/id_rsa_rdiff-backup |
| + | RemotePath=/var/backup/rdiff-backup |
| + | RemotePort=22 |
| + | RemoteUser=rdiff-backup |
| + | RemoveOlderThan=6W |
| + | status=enabled |
| | | |
− | === Installation === | + | In the configuration above, my local backup is enabled, and backs up to /media/usbdisk1/rdiff-backup/$sysconfig{SystemID}/ |
| + | |
| + | The remote backup is currently disabled, but backups up to a host called 'timtam' using the SSH key shown above, with target path of /var/backup/rdiff-backup/$sysconfig{SystemID}/ |
| + | |
| + | The remote backup is done as user 'rdiff-backup' remotely (root locally). |
| + | |
| + | ====To enable LOCAL backups==== |
| + | |
| + | - mount the media you want to use for backups, create the directory on the |
| + | mounted device for the backup (this must be <target directory>/rdiff-backup) |
| + | and then make sure /media/usbdisk/rdiff-backup is owned by rdiff-backup. |
| + | |
| + | mount /media/usbdisk (adjust mount point according to your system setup). |
| + | mkdir /media/usbdisk/rdiff-backup |
| + | chown rdif-backup:rdiff-backup /media/usbdisk/rdiff-backup |
| + | |
| + | |
| + | Note: Currently /media/xxxx devices are not automounted by default. You must mount the intended media after each bootup or the backup won't work. This mounting process may be automated in the future |
| + | |
| + | Note2: Starting SME 8.X and SME 9.X folders with disk label as name are not created any,ore in /media/, it is your responsibility to create one and mount your drive. |
| + | |
| + | - Set your configuration: |
| + | |
| + | config setprop rdiff-backup LocalPath <whatever>/rdiff-backup |
| + | config setprop rdiff-backup EnableRemote no |
| + | config setprop rdiff-backup EnableLocal yes |
| + | config setprop rdiff-backup status enabled |
| + | expand-template /etc/crontab |
| + | |
| + | ====To enable REMOTE backups==== |
| + | |
| + | - install smeserver-rdiff-backup on both ends |
| + | - This will create a 'rdiff-backup' user |
| + | |
| + | On the machine to be backed up: |
| + | |
| + | config setprop rdiff-backup RemoteHost <whatever> |
| + | config setprop rdiff-backup RemotePath <whatever>/rdiff-backup |
| + | config setprop rdiff-backup EnableRemote yes |
| + | config setprop rdiff-backup EnableLocal no |
| + | config setprop rdiff-backup status enabled |
| + | expand-template /etc/crontab |
| + | |
| + | ssh-keygen -t rsa -f /root/.ssh/id_rsa_rdiff-backup -N '' |
| + | expand-template /root/.ssh/config |
| + | |
| + | On the backup server: |
| + | |
| + | - Create OR Append /root/.ssh/id_rsa_rdiff-backup.pub to ~rdiff-backup/.ssh/authorized_keys2 |
| + | |
| + | Note: Permissions should also be 0400 rdiff-backup:rdiff-backup |
| + | Note2: If both ends are trusted then you can put the ssh in root's .ssh directory and run the remote as root. This will mantain proper file ownership. Otherwise all the backup files are saved as the user rdiff-backup. |
| + | |
| + | usermod -p '*' rdiff-backup # This enables SSH only |
| + | |
| + | Note: You can enable both Local and Remote backups at the same time. rdiff-backup |
| + | will perform the local backup first then the remote. |
| | | |
| + | Note: Always use a subdirectory 'rdiff-backup'. If the backup disk |
| + | isn't mounted, this saves you from filling the parent filesystem. |
| | | |
− | yum --enablerepo=smecontribs install smeserver-rdiff-backup
| |
| | | |
− | Also see the notes here | + | Also see the notes here: |
| | | |
| http://forums.contribs.org/index.php/topic,35525.msg155709.html#msg155709 | | http://forums.contribs.org/index.php/topic,35525.msg155709.html#msg155709 |