7

Hello I am trying to use a batch file to log into a server using plink, go to specific directory and run commands. I can not get this to work. Appreciate any help.

plink -t -ssh root@111.111.111.111 -pw xxxxx
cd /home/wonderd/public_html/dev.xxxx.com
./shell/indexer.php --reindex catalog_product_price
Rob
  • 14,746
  • 28
  • 47
  • 65
Daniel A
  • 71
  • 1
  • 1
  • 2

2 Answers2

9

First I think you have to write the machine name or IP after the plink call The second issue is that plink run always from root directory so you have to send couple commands together separated by ;

like this :

plink.exe <full name of machine / IP> "command one; command 2"
Roman
  • 1,727
  • 1
  • 20
  • 28
Hava L.
  • 111
  • 1
  • 5
1

Try:

plink root@192.168.0.1 -pw xxxx (cd /home/path to script ; ./script.sh)
Bugs
  • 4,491
  • 9
  • 32
  • 41