Launch Linux Script remotely from Windows

6,400

You should do it via a SSH command. You just need to setup plink.exe . You can download it at:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Then, from a batch file like this one, exectute it:

@ECHO off
:: run remote command
plink.exe username@myserver /cygwin/C/Users/username/do-backup.sh
ECHO Remote command finished...
PAUSE>nul
Share:
6,400

Related videos on Youtube

Kashif
Author by

Kashif

Updated on September 18, 2022

Comments

  • Kashif
    Kashif over 1 year

    I have an rsync script that runs on one Linux server to synchronize files with another Linux server. Is there a way to launch a script on one of the Linux machines without actually opening an interactive ssh session to the server?

  • Kashif
    Kashif about 12 years
    but I'm looking to make a batch file or something like that, that will login into my linux bux and run that script... so it is possible by using Cywgin?
  • Tim
    Tim about 12 years
    Yes. Bash in Cygwin is nearly the same as bash under any *nix.
  • Kashif
    Kashif about 12 years
    actually I'm not looking to automate this command. I'm looking to make it manual but then it should automatically login to server and run script. Actually I need rsync on different times so i want to keep it under my control to get rsycn whenever i want without going to server.
  • dmars
    dmars about 12 years
    Then you just need to put it the line in a batch script as djangofan wrote and run the script when needed.