On Windows:
- Install Copssh and cwRsync server. Use the same service account.
- Start RsyncServer and OpenSSHD services
- Activate a user
- Import your public key via Copssh Control Panel:
- Make sure that the user and the service account has write access to c:\backup
- Add a new module to rsyncd.conf :
[backup] path = /cygdrive/c/backup read only = false transfer logging = yes
On Linux:
- Use shell script below after having it updated according to your needs:
#!/bin/bash localport=9119 remoteport=873 remotehost=192.168.100.21 rsyncmodule=backup remoteuser=lab1user sourcedir=/bin/ echo Establishing secure channel ... ssh -L $localport:127.0.0.1:$remoteport $remoteuser@$remotehost -T -N -f rsync -vrt $sourcedir rsync://localhost:$localport/$rsyncmodule echo Terminating secure channel ... ps ax | grep "ssh -L $localport" | awk '{print $1}' | xargs -i kill {} 2&>/dev/null