Cloud backup with rsync

We backup some folders to a remote host using rsync. The destination folder will use compression.

At first login to the remote server and allow ssh access as root (make sure, password authentication is disabled). We need this to fully backup permissions:

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
service sshd restart

Now create a backup volume:

zfs create -o compression=zstd-10 -o mountpoint=/backup zroot/backup

Backup using rsync

The backup will copy files from windows to a NAS that has a share available via rsync.

Install Cygwin

Make sure you have cygwin installed with the package rsync.

For all further steps I expect that cygwin was installed in C:\cygwin64

Configure the NAS

Backup Script

I store my script in folder %userprofile%.

#!/bin/sh
rsync -aP --delete /cygdrive/d/bilder rsync://idefix@nas/Bilder

Shortcut in Windows

To get the script easily executed we create a shortcut on our desktop.

Fill as target:

C:\Windows\System32\cmd.exe /c ""C:\cygwin64\bin\sh.exe" --login -i /cygdrive/c/Users/idefix/backup.sh"

Fill as path:

C:\cygwin64

If you now click the shortcut, it should open a window and directly start with the sync.