Problem loading root through ssh

UPDATE: SOLVED

I feel bad figuring it out the day I posted this, especially since it was so simple. just added:

export ROOTSYS=/usr/root
export PATH=$PATH:$ROOTSYS/bin

before the call to load root. hope this helps someone else down the line.

END UPDATE

I’m doing some stuff on a Data Acquisition box (DAQ) running linux, and it has been requested by my boss that I graph the output of all the acquired data automatically every time. My quick fix plan was, I wrote a graphall.cpp file on a remote pc also running linux with root installed and scp’ed the .data files over. I then tried to run (from within the c++ file on DAQ box)
ssh usr@host root -b graphall.cpp
which gave me error: root: command not found. So I decided I’d just work around it, and am now accessing a shell script on the remote pc that contains the command:
/usr/root/bin/root graphall.cpp
but it now says that rootsys isn’t setup correctly.
It works fine if i use a terminal on the DAQ:
$ ssh user@host
$ root -b graphall.cpp
but not if i try to combine the commands:
$ ssh user@host root -b graphall.cpp
error: root: command not found
like i’d need to do from within the C++ file.

if you can provide any help, it’d be appreciated.

This is my first post, and i’ve tried to follow the protocol I’ve noted so far. Forgive any oversights. (but please point them out)
Thanks, Branden

You must set the environment (PATH,LD_LIBRARY_PATH) before executing root.exe, eg by doing

ssh user@host "mysetup.sh; root -b -q graphall.cpp"
Rene