Skip to content

Script for incremental backup to OS X Sparse Bundle with rsync over ssh.

Notifications You must be signed in to change notification settings

mxl/backup-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

backup-tool

Script for incremental backup to OS X Sparse Bundle with rsync over ssh.

Prerequisites

Local host:

  • install rsync;
  • generate ssh key for root user;

Remote host that will be backed up:

  • run ssh daemon on port 22;
  • install rsync on local and remote hosts;
  • create rsync user on remote host: sudo useradd -m -s /bin/sh -N rsync
  • add this line to sudoers file: rsync ALL=(ALL) NOPASSWD: /usr/bin/rsync --host --sender -logDtprze.iLsf --numeric-ids . /
  • append public key of generated ssh key to /home/rsync/.ssh/authorized_keys on remote host.

Usage

Script must be runned as root.

Use following environment variables to configure script:

host_NAME (required) - domain or ip of remote host that will be backed up. DESTINATION (required) - destination folder for backup. EXCLUDES (optional) - path to file that contains paths that should be excluded from backup and is used in --exclude-from option of rsync. MYSQL_PASSWORD (optional) - password for MySQL root user. PSQL_PASSWORD (optional) - password for PostgreSQL postgres user.

Run script:

host_NAME=example.com DESTINATION=~/mybackup EXCLUDES=~/mybackup/excludes.rsync ./backup.sh

About

Script for incremental backup to OS X Sparse Bundle with rsync over ssh.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages