-1

I'm trying to run a python script on a remote linux machine accessed by ssh(putty). I want to change/access directory to the windows directory and run a program which converts files on the server to csv and saves them to the server.

Is it possible to run the program without moving the files from remote to local, run conversion, move local to remote?

I am not the root user and can't install anything on the linux machine. My Windows is 64bit and the linux machine is 64bit Ubuntu. Any suggestions?

rokman54
  • 161
  • 1
  • 3
  • 15
  • 3
    What are you trying to do? What you're asking doesn't make sense. How do you expect a python program running on a linux machine to be able to `os.chdir('C:/ndfd/degrib/bin/')`? Or run a binary that's on your local machine? – ComputerDruid Feb 26 '15 at 16:58
  • Huh? you are running a windows command line utility on a python script running on a linux machine? – jgr208 Feb 26 '15 at 16:59
  • wait so the script runs on your machine and connects to the linux server? – jgr208 Feb 26 '15 at 17:01
  • Script runs on the linux server which I connect to using ssh. The local program runs for files on the linux server. – rokman54 Feb 26 '15 at 17:02
  • what is this local program? – jgr208 Feb 26 '15 at 17:03
  • It's called degrib and it converts grib files to csv files. I want to convert grib files on linux and convert/save them to the server. – rokman54 Feb 26 '15 at 17:06
  • 1
    If your data is on the linux server, and you want to keep the files on the linux server, I think you will need to install degrib on the linux server. You don't need root to do that with `./configure --prefix=your-target-directory`. Instructions here http://www.nws.noaa.gov/mdl/NDFD_GRIB2Decoder/compile.php?os=unix – Simon Fraser Feb 26 '15 at 17:17
  • Yes, I have explored that. The problem is that you need to change the script for 64 bit linux. I'm not an expert enough to change a 32bit linux configuration bash script to one for 64bit – rokman54 Feb 26 '15 at 17:23
  • the script will be exactly the same - all config-linux.sh does is run ./configure with one option. What do you get when you run `./configure CFLAGS="-O3" --prefix=/tmp/` and then `make`? – Simon Fraser Feb 26 '15 at 17:36
  • Yes, the config script is written for 32bit linux. To config on 64 bit there are quite some change you have to make. https://groups.yahoo.com/neo/groups/degrib/conversations/topics/19 – rokman54 Feb 26 '15 at 17:39
  • It seems to build on 64 bit Ubuntu for me, at least until I hit a previously reported bug about gzopen() calls. Depends on your distribution. – Simon Fraser Feb 26 '15 at 17:43
  • Yes, I think it does. configure: error: in `/home3/so2207/degrib/src/libxml': configure: error: C++ preprocessor "/lib/cpp" fails sanity check I get this error. – rokman54 Feb 26 '15 at 17:54
  • sshfs for windows, worked in my case. https://github.com/billziss-gh/sshfs-win – Kot Jan 28 '20 at 07:27

1 Answers1

-1

I found a way to do what I wanted. Doing what I initially wanted requires me to transfer the files from the local machine to the remote machine then running the script and transferring it back. Ultimately it's a function of how fast my internet connection is. Since my local connection isn't that strong, I realized that my initial thoughts were flawed. Eventually, I just uploaded my data to the remote machine and run the script there. It was the fastest solution

rokman54
  • 161
  • 1
  • 3
  • 15