ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i have a bash script that runs on my local computer
and moves files from one remote computer to another
for processing. the processing computer executes its
processing via its own bash script.
is there a way i can have my local computer's script
tell the processing computer to run its own processing
script? currently, i'm waiting for the local script to
complete and then going over to the processing computer
to start its script. would be a lot easier if i could
put it all into the local script. just have no idea
great suggestion neuzen. one question: if, as you suggest,
i issue a command via ssh, and that command is to run a
script on the remote computer, when does my local script
continue? after the ssh command is issued? after the remote
script starts? after the remote script ends? if it's the
last of these possibilities i'd have a problem since the
remote script will take hours to run and i'm ready to move
on as soon as it's been told to start running.
oops. just hit a snag. got ssh working and can start a remote
script from my local script (yay!). problem is, remote script
has to be in remote's home directory, not subdirectory. i
need to send both a cd command, as well as the command to
start the script. so far, all i know how to do is the login
and send one command. i have this to run the script if it's
in the home directory:
ssh useracct@remotecomputer ./script_to_run.sh
what i need to be able to do is something like:
ssh useracct@remotecomputer cd Documents/Scripts ./script_to_run.sh
thanks neuzen and jschiwal. i had one of those 'DOH!' moments
driving home after posting the question when i realized just
what you're saying. i'd still be very interested, though, to
know about issuing multiple commands through an ssh script.