This blog post encompasses how to install and use RSYNC between a client and a server. The server in this case is a Windows 11 desktop computer with the desired drive D:/, and the client in this case is a Raspberry Pi 3B+, with a 1 TB micro SD card as storage. RSYNC allows for the server folder of choice to be updated on the client side at given intervals, such as this case whenever the desktop computer is turned on.
On the windows 11 desktop computer:
Git
Windows Subsystem for Linux (WSL) (see 5, below, for detail)
wsl --install
On the Raspberry Pi:
Enable SSH
sudo systemctl enable ssh
sudo systemctl start ssh
SSH into the RPI and find the hostname
hostname -I
Create a folder to sync to on the RPI
mkdir -p ~/synced_folder
On the desktop, open Git Bash and generate a SSH key and save it to the provided location. Don’t bother with the passphrase, it will not be needed later.
ssh-keygen -t rsa -b 4096
Test the generated key to SSH into the RPI, without using the RPIs password. If the username of your RPI is something other than pi, then replace that throughout the process.
ssh-copy-id pi@pi-ip-address
Possible issues to counter:
ssh-copy-id: command not recognised. Make sure you are using Git Bash, and not windows cmd or powershell. If it still doesn’t work, ask A.I.
CAUTION: may take some time to load! Do not fret, give it time.
Once loaded, it will say “The authenticity of host '192.168.1.120 (192.168.1.120)' can't be established.” Simply type ‘yes’ and continue.
If it states another error, follow the instructions it gives and try again.
If the RPI refuses to connect, you may need to copy the public key over to the RPI.
cat ~/.ssh/id_ed25519.pub | ssh pi@pi-ip-address 'mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys'
On the windows desktop (Git Bash still):
scp ~/.ssh/id_ed25519.pub pi@pi-ip-address:/tmp/
Then, SSH into the RPI and run these commands to install the key:
ssh pi@pi-ip-address
mkdir -p ~/.ssh
cat /tmp/id_[YOUR_FILE_NAME].pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
rm /tmp/id_[YOUR_FILE_NAME].pub
You will have to replace the id_xyz.pub with whatever you named your file in step 4.3. Afterwards, retest the password less SSH into the RPI with the below line.
ssh pi@pi-ip-address
Test for WSL compatibility: