Skip to content

Backup a Windows host using built-in SSH and WSL Rsync #16

@xezpeleta

Description

@xezpeleta

Apparently is it possible to configure a Windows host without Cwrsync, using SSH + Rsync like linux hosts. Maybe we should test it and add it to our documentation.

From rsnapshot.org website:

Windows 10 native OpenSSH server and WSL2

For Windows 10 (1809+) machines, another option is to use the native OpenSSH server now available in Windows 10 1809 and WSL2. By using the native ssh server, WSL does not have to be running for the backup to occur.

  • Install the native OpenSSH server in powershell.
  • Key based access is still required and setup can be a bit strange, see the following StackOverflow post answer for what configuration steps are required.
  • Install WSL2 and your Linux distribution of choice. Make sure rsync is installed and available in that distribution.
  • Use WSL2’s rsync by including rsync_long_args='--rsync-path=wsl rsync' in the backup command. Take care with the single quote placement so the configuration will be executed correctly. By providing wsl rsync, this executes the rsync command in WSL instead of trying to execute it via Windows.

Example backup command configuration for Windows machines

This assumes that key based access for John Doe is properly configured on the remote system. (And that tabs are used between the fields)

backup    192.168.1.2:/mnt/c/users/John\ Doe/    johndoe/    rsync_long_args='--rsync-path=wsl rsync',ssh_args=-l 'John Doe'

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions