Scroll(bar) Free

A nice, accurate, walkthrough can be found here, although you'd be best of with man rsync and man rsync.conf.

# Create mount point

root@box-backup:~# mkdir /mnt/db4
root@box-backup:~# mount /dev/sdb1 /mnt/db4/
root@box-backup:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 3.1G 1.2G 1.8G 40% /
none 3.9G 124K 3.9G 1% /dev
none 3.9G 0 3.9G 0% /dev/shm
none 3.9G 40K 3.9G 1% /var/run
none 3.9G 0 3.9G 0% /var/lock
/dev/sdb1 1.6T 197M 1.5T 1% /mnt/db4

# Configure rsync

root@box-backup:~# touch /etc/rsyncd.conf
root@box-backup:~# nano /etc/rsyncd.conf

motd file = /etc/rsyncd.motd
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock

[rsync1]
   path = /mnt/db4
   comment = rsync 
   uid = nobody
   gid = nobody 
   read only = no
   list = yes
   auth users = tmpusr
   secrets file = /etc/rsyncd.scrt

root@box-backup:~# touch /etc/rsyncd.scrt
root@box-backup:~# nano /etc/rsyncd.scrt

tmpusr:ASecret123

# start rsync daemon on target

root@box-backup:~# rsync --daemon
root@box-backup:~# netstat -a | grep -i rsync
tcp 0 0 *:rsync *:* LISTEN 
tcp6 0 0 [::]:rsync [::]:* LISTEN

root@box-backup:~# useradd tmpusr
root@box-backup:~# passwd tmpusr
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

root@box-backup:~# chown -R tmpusr /mnt/db4
root@box-backup:~# chgrp -R tmpusr /mnt/db4
root@box-backup:~# ls -lah | grep -i db4
total 12K
drwxr-xr-x 3 root root 4.0K 2012-10-01 15:50 .
drwxr-xr-x 21 root root 4.0K 2010-12-06 12:23 ..
drwxr-xr-x 3 tmpusr tmpusr 4.0K 2012-09-28 13:24 /mnt/db4

# connect from source

root@box:~# rsync --verbose --progress --stats --compress --rsh=/usr/bin/ssh \
      --recursive --times --perms --links \
      /var/lib/mysql* tmpusr@box-backup:/mnt/db4/

11:34:17am, 15th Nov 2014

d7f2ac6936

0 Comments