0

I want to be able to synchronize a directory between my Windows laptop and raspberry pi using WinSCP. By "synchronize" I mean if a file is created in the directory by my raspberry pi, it is automatically placed in predefined directory on my laptop.

I have already set up a WinSCP connection between these two devices.

I was following along using this tutorial https://www.youtube.com/watch?v=ndvEYOQLc4c however I reliazed that this was for an FTP server and I also could not save the .bat file or code file into the appropriate directory as it has it has an administrator lock, so I assume that the method is only for FTB servers.

Edit

I have given myself permissions to save the code files in the appropriate places, however I now receive the error

Host "lynn-vs2.cloudapp.net" does not exist.

Whenever I run the bat file:

winscp.com /script=SyncToLocalScript.txt

pause

Which in turn runs the txt file:

option batch abort
option confirm off
open sftp://sftpuser04:password123!@lynn-vs2.cloudapp.net -hostkey="ssh-ed25519 256 00:69:55:c8:a8:84:01:6d:7c:ff:9f:8c:89:b3:7d:67"
synchronize local C:\Users\****\OneDrive\Desktop\RaspPCAP /home/pi/Desktop/PCapFiles
exit

I am not sure what "lynn-vs2.cloudapp.net" is.

Lyra Orwell
  • 1,048
  • 4
  • 17
  • 46
  • Just save the bat/code to any directory, where you have permissions for. – Martin Prikryl Feb 05 '20 at 11:51
  • @MartinPrikryl I just saved them in the correct place by giving myself administrator privileges – Lyra Orwell Feb 05 '20 at 12:08
  • Saving the file to a location that requires administrator privileges is probably *not the correct place*. But as you wish. – Martin Prikryl Feb 05 '20 at 12:21
  • Regarding your new problem: Can you connect to `lynn-vs2.cloudapp.net` anyhow? Using WinSCP GUI? Using any other SFTP/SSH client? – Martin Prikryl Feb 05 '20 at 12:21
  • @MartinPrikryl No i could not connect to it. Is their any alternative? – Lyra Orwell Feb 05 '20 at 14:54
  • Alternative to what? Afaik, Raspberry Pi, as most Linux servers, does run SFTP/SSH server by default. So what you do, should work, assuming your hostname is correct. If it does not work, you do not have a programming question, so it does not belong here. For connectivity problems, go to [su], or more specifically to [Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/). – Martin Prikryl Feb 05 '20 at 14:56
  • Rather than synchronise files and copy them backwards and forwards, you could just share a directory on your PC with the Pi, or on your Pi with the PC like this https://stackoverflow.com/a/38761844/2836621 – Mark Setchell Feb 18 '20 at 10:07

0 Answers0