Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
when I execute the command , it asks me password and wait for almost 10 seconds(usually it takes 10 secs to run measure.sh). measure.sh is supposed to also redirect result of script to a file, when normally I run script on the machine its located, I can see the output file, but when I run it remotely, the output file is not created. I do not know what is the problem and any help is appreciated.
1. It asks for root password for the machine where you're trying to login.
2. It either takes time in establishing connection, or there's some issue with shell on remote machine. May be a different shell configured for root on remote machine as compare to your local machine. So once invoke:
~$ ssh email@example.com "echo $SHELL"
Also check if /home/guest/Desktop/measure.sh exists on remote machine or not? I doubt it's on your local machine, and you're trying to run it on remote machine.
3. If output file isn't generated then I doubt that your script is running on remote server or may be it doesn't exist on remote machine. So once login on remote machine and invoke it (not with ssh) like:
But again the log file(which should be measure_download.log) is not created. In fact the script is downloading a file from server and measure the time. Even the file which should be downloaded does not exist.
What I noticed is the following:
the downloaded files and log are created in the root directory (/root/)of remote machine. But I need them to be in the Desktop, I know that I can write script to move them to Desktop, but I have more than 100 experiments and I should to that for all of them. I just want to fix this problem.
Most likely the log has been created in the HOME directory of the remote machine (and maybe even the file was downloaded there). You have to options: use absolute paths inside the script or change to the directory containing the script itself. You can do this from inside the script in a reliable way using:
The default dir is the one you login to, so $HOME, even though you call it in /home/guest/Desktop.
Easiest fix is to cd /home/guest/Desktop at the top of the script, before it does any processing.
Alternately, tell the process (downloader?) where to put files/logs.