Rsync to NAS

I use rsync to backup my documents and my pictures from my Windows laptop to my NAS using Cygwin.

Prerequisites:

  • NAS running SSH.
  • NAS having rsync available (http://en.wikipedia.org/wiki/Rsync).
  • SSH user account is available on NAS. In my example the username is: 'admin'
  • Target directory on NAS is writable by the NAS user. In my example: '/mnt/disk/volume1/rsync/'
  • Cygwin installed on Windows pc, including rsync client. (http://en.wikipedia.org/wiki/Cygwin)

Assuming

  • SSH is not running on default port but on port 4422.

Open Cygwin on your pc and run:

Martijn@Studio-15 ~
$ cd /cygdrive/c/Users/Martijn/Pictures/

Martijn@Studio-15 /cygdrive/c/Users/Martijn/Pictures
$ rsync -av --progress --inplace --rsh='ssh -p4422' . admin@192.168.0.10:/mnt/disk/volume1/rsync/Pictures
admin@192.168.0.10's password:
sending incremental file list

sent 467155 bytes  received 935 bytes  13567.83 bytes/sec
total size is 93924571734  speedup is 200654.94
Martijn@Studio-15 ~
$ cd /cygdrive/c/Users/Martijn/

Martijn@Studio-15 /cygdrive/c/Users/Martijn
$ rsync -av --progress --inplace --rsh='ssh -p4422' ./Documents admin@192.168.0.10:/mnt/disk/volume1/rsync/Documents
admin@192.168.0.10's password:
sending incremental file list

Note: this option uploads all new changes to files to the NAS. It adds files, it does not remove files from the NAS that have been removed from the PC.

Attributes

-v, --verbose               increase verbosity
-a, --archive               archive mode
    --inplace               update destination files in-place
    --progress              show progress during transfer
    --rsh='ssh -p4422'      connect via SSH to port 4422

For detailed information read: http://rsync.samba.org/ftp/rsync/rsync.html

Attribute tips

-z, --compress              compress file data during the transfer
    --de lete               de lete extraneous files from dest dirs

More examples

Read the manual, the usages page contains examples: http://rsync.samba.org/ftp/rsync/rsync.html

rsynctonas.txt · Last modified: 2012/10/20 21:05 by rmorrien
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki