General :: Ssh'ing To A Host And Executing A Command Not Working Correctly?
Aug 20, 2010
I have the following command:ssh $USER@$HOST "ls /ops/pkg/ec/`grep "PKRTS" /ops/pkg/ec | awk '{print $1}'`* > /tmp/tmp_file"What the above SHOULD do..is, ssh to the host then execute the command.The command should first execute the grep and awk between the back ticks, and generate a file name, then ls using that filename* and write that data to a temp file.However, it executes the grep and awk before even SSH'ing and the command that goes to the server is simply an "ls /ops/pkg/ec/* > /tmp/tmp_file" since the grep and awk return nothing on the local machine.
View 1 Replies
ADVERTISEMENT
Jan 2, 2011
why this command:
/usr/bin/freepopsd -vv > /home/shocker/Desktop/Freepopsd.log
doesn't write the log in the Desktop folder? It's written exactly like that in the Ubuntu startup program control panel and according to the ps command I understand it's correctly running:
$ ps aux | grep freepopsd
shocker 1676 0.0 0.1 227264 9128 ? S 13:22 0:00 /usr/bin/freepopsd -vv > /home/shocker/Desktop/Freepopsd.log
What am I missing?
View 2 Replies
View Related
Mar 2, 2011
I own a CentOS 5 VPS. I typed crontab -e, and then I added the following line to automatically have my server backup mysql
0 * * * * mysqldump -u root -p password --all-databases | gzip > /home/dbbackup/database_`date '+%m-%d-%Y_%H'`.sql.gz
When I go in and look, it doesn't place any files in /home/dbbackup. When I run
mysqldump -u root -p password --all-databases | gzip > /home/dbbackup/database_`date '+%m-%d-%Y_%H'`.sql.gz
View 3 Replies
View Related
Oct 20, 2010
HOW TO GET THE IP ADDRESS OF HOST IN LINUX WITH USING OF HOST AND NSLOOKUP COMMAND and after getting the ip address how to assign it in the variable
View 4 Replies
View Related
Aug 6, 2010
I have a some c source code files that i have to copy to linux machine from a windows machine over a network. This source code folder has to be copied into a particular directory structure in the linux system at the other end. After copying the file into the appropriate folder in the linux server i have to instruct the linux machine to make(using the make file that is there with the c files) this source code from the windows machine. Does anyone have any idea in regard to how this can be implemented?? i am trying to have a gui client that has the above mentioned options(copying and inserting the c files into the appropriate directory and then for making the files and getting the executable.)
View 3 Replies
View Related
Dec 17, 2010
I tried to execute a shell command by M-! cmd RET but it did not work.M-! does not turn up in the microbuffer no matter how many times I press Alt+!.But if I go to Tools menu and select Shell Command... option then it writes M-! to the microbuffer and everything works fine.What is the problem here?
View 2 Replies
View Related
May 27, 2011
I'm trying to run an application from the command prompt. I've set the path in .bashrc. My executable file and all other files needed by it are saved in the same directory as the path. When I enter the executable name to run it, I get an error message saying that the command is not found.
View 14 Replies
View Related
Feb 28, 2010
I am working behind a http proxy (172.30.x.x:3128). I have configured it in my terminal. All the applications such as wget,lynx firefox etc. are working correctly.However all dns utilities like nslookup, host and even ping too are not working.Following is output of host command:
Code:
root@ding:~# host google.com
;; connection timed out; no servers could be reached
Output of host -T:
[Code]....
To connect to net I have to first run dhclient3(learnt from this forum!).It gives me my ip but where is dns address sent I don't have and idea.
View 14 Replies
View Related
Jul 30, 2011
I want to execute a awk command, which reads from txt files and sums the numbers from the first column for those listed only inside a <init> block -- The awk command is like
Code:
awk '/</?init>/{x = !x}x{a++}x && a > 2{sum+=$1}END{printf"%E" "
", sum}
So, I want to execute it inside a perl script, and execute the awk command for the infile which is also defined outside awk loop, ie doing something like
Code:
foreach $infile (@ARGV) {
$gzin = gzopen($infile, "r") || die ("Couldn't open file $infile
");
# No. events and cross-section from current file
[code]....
View 1 Replies
View Related
Jun 14, 2011
When i try to execute scp command:
scp -r /localhostdirectory username@remotehostservername:/remotehostdirectory
I get the following error
0509-036 Cannot load program /usr//bin/ssh because of the following errors:
0509-150 Dependent module /homepath/server/bin/libcrypto.a(libcrypto.so.0.9.8) could not be loaded.
0509-153 File /homepath/server/bin/libcrypto.a is not an archive or
the file could not be read properly.
0509-026 System error: Cannot run a file that does not have a valid format.
View 6 Replies
View Related
Apr 30, 2010
I upgraded karmic to lynx today and I'm stuck with some weird behaviour with one of my virtual hosts. The virtual hosts under /var/www/site work but my virtual host for DAVICAL which points to /usr/share/davical/htdocs/ doesn't.
Navigation to any html pages works but php files just show up blank!
Has there been a configuration change in lynx for virtual hosts outside of /var/www?
View 6 Replies
View Related
May 4, 2011
I'm working with Linux 2.6.23 on an embedded device and am receiving the following error executing the reboot command.
View 2 Replies
View Related
Aug 30, 2011
According to the man page, host ought to query "the server or servers listed in /etc/resolv.conf," but it only uses the first entry in that file:
thefourthtower:$cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
[code]....
View 3 Replies
View Related
Dec 8, 2010
I have a problem, I set a Debian server with no GUI. I have set http_proxy and I want to add ignored hosts for local address like I did in Ubuntu(System->Preference->Network Proxy->Ignored Hosts).How can I do that in Debian (with no GUI only bash) like I did in Ubuntu with GNOME Desktop?
View 2 Replies
View Related
Aug 24, 2010
what we are trying to do is, to let the customer click a button in the web browser, and then the web server to call a shell script to do the work. The output from the stdout && stderr of the script should be displayed in the web browser once finished or timeout, along with the exit code of the script.
The shell script is however not on the web server, but on another app server. So to call this script from the web server as the identity 'tomcat':
Code:
$ sh appuser@app-server:$appbin/app-script
The .ssh/id_rsa.pub thing is done, and we have no problem doing this in the command line so far.
Our loaded ex-colleage has left us the webpages (jsp) with code like these:
Code:
<%@ include file="jsp_functions.jsp" %>
<%
String cmd = "sh $appbin/app-script";
ExecResult r = new ExecResult();
[Code].....
View 6 Replies
View Related
Dec 29, 2010
I'm in a situation, that I have no access to one of my remote server. And I CAN'T EVEN INSTALL ANY SOFTWARE in any linux boxes to determine the remote OS name and version.Can you please enlighten me on how could I find out the OS version of remote host without installing any software or without login to that server.
View 1 Replies
View Related
Apr 7, 2010
im searching for this answer now a pretty long time and i know that many similar questions where asked and i all looked themIm trying to run a the command "vncserver" on our opensuse11.2 server when its booted.many posts here endet in "put a sh script into your /kde4/Autostart" but that didtn help for me because the server runs without a screen and normally nobody is logged in. When i logged in that worked fine.i also tried to add the command "vncserver" to "/etc/init.d/boot.local " but that didnt work too. i think its to early executed to work.i also tried to activate the service to start up at boot with chkconfig vncserver start but the service vncserver is "unknown". when i type vncserver into the console after logging in everything is alright.you see i really tried a lot and searched a long time at google and in this forum but nothing worked
View 4 Replies
View Related
Mar 31, 2010
I want to fix my dns if I issue command service named restart it just wont execute the command all it say is connection refused error from rc.d just cannot figure out what the problem is my server is ruining on red hat Linux 9 which is also my proxy server.
View 6 Replies
View Related
Oct 5, 2010
If I type this manually on the command line, it works
Quote:
ssh -Y user@machine 'firefox &'
I ssh into the remote machine as the named user and pop an instance of firefox from that machine back to my own. If I put the same thing into a shell script though, it fails.
Quote:
#!/bin/bash
ssh -Y user@machine 'firefox &'
I'm just left sitting at a command line on the remote machine. Why does the script fail and how can I make it work?
View 4 Replies
View Related
Jul 8, 2011
I need to execute an external command with Python from Web. I know there is subprocess module that executes external programs but I'm trying to execute a command registered for the execution of a program. In this case when I execute my file in the shell everything is Ok, but from the Web it doesn't work.
View 1 Replies
View Related
Feb 11, 2010
I wrote a shell script and tried to execute it in separate terminal using command 'gnome-terminal -e <script>'. When executing first time, it went fine.From second time, I am getting error 'There is error creating child process for this terminal' repeatedly.
View 5 Replies
View Related
Nov 16, 2010
I have a php file that I need to execute via a cronjob. This file should be run by the www-data user as its a file in my /var/www/project folder. When I run this file under root (php -f cron.php) everything works perfectly, but I want it to run under the www-data to be safe. Before I run it vai crontab I tried it via command line as the www-data user and I receive errors:
Fatal Error: Allowed memory size of 8388608 bytes expired (tried to allocate 232 bytes).
But when I run it as the root user I get no errors and everything works correctly. The file cron.php is used to process automated tasks in my CRM. So I don't really want to have the root user running a crontab every few minutes for this.
Must the www-data user be given more permissions? I am using Ubuntu 6.06LTS
PHP - 5.1.2
Apache - 2.0.55
MySQL - 5.0.22
View 4 Replies
View Related
Mar 28, 2011
I was just curious if cron had to be enabled before use. i have a crontab, and the cron daemon is running, but the command isn't executing...
View 9 Replies
View Related
Mar 4, 2011
Why does ping see audit.median.hu as 127.0.0.0, and why does host -t a audit.median.hu see it as 193.68.35.149? audit.median.hu is just an example site [hosts ads, etc.]
I just have a caching nameserver on my Fedora PC:
I configured my DNS server addresses in the Network-Manager Applet: 127.0.0.1, 8.8.8.8
Even with Wireshark, I can see it:
So the big question: Why don't the host command or my web browser recognize that I have modified audit.median.hus IP address?
View 1 Replies
View Related
Nov 13, 2009
I use a Dell inspiron 1525, with windows 7 and fedora 8 in dual boot. Ihave broadcom 4310 wireless card to use.. how ever i could not activate my wireless.. so i guess this the right place where i can get a solution to the problem. After installing the ndsiwrapper by yum, i tried to execute the command ndiswrapper -i bcmw15.inf This returns with an error couldn't open bcmw15.inf: No such file or directory at /usr/sbin/ndiswrapper line 219.
View 1 Replies
View Related
Aug 23, 2010
I m using Redhat Linux 5......I am trying to install Nero 4 DVD Writer s/w...It is an exe file ...
I have given permission like this:
Then i execute the file like this:
Its showing error like this:
View 9 Replies
View Related
Jan 14, 2011
A colleague gave me a shell script ("dti_motion") which needs to be run from the directory containing all the files it works on. I want to run the same script for several different directories. But I don't want to have to cd into each directory, run the script, wait for it to finish, and then cd to the next directory (there are 52 to do altogether).
So I wanted to write a very simple script that will cd to each directory and perform the script there, before going on to the next one. My colleague's script ("dti_motion") is stored in my home/bin/ and is executable. My home/bin/ is in my path, as verified by echo $path. When run from a directory containing the necessary information, the dti_motion script works perfectly well. I wrote an extremely inelegant script called "dti_motion_do_all" which is also stored in my home/bin/ and executable:
#!/bin/sh
#Get motion information for each subject, using Mark's script, called dti_motion
cd /imaging/cr01/PD_DTI/C_10/12x5
[code]....
I know there will be more elegant ways to write this script with loops, rather than simply using cd, but for the moment, I just want this to run, until I have learnt to use loops properly. how to correct either of those "command not found" or "no such file or directory" errors, given that both the original dti_motion and my dti_motion_do_all script are in my /home/bin/ (which is on my path) and both scripts are executable?
View 1 Replies
View Related
Nov 15, 2010
command to show the luns mapped to redhat enterprise server 6.1 host. And how do i known the WWNN for the FC HBA attach to the host.
View 6 Replies
View Related
Aug 3, 2011
I tried to install ndiswrapper , but its showing error,while executing make command
make[1]: Leaving directory `/usr/src/linux-source-2.6.35.8'
make: *** [LINUX] Error 2
View 2 Replies
View Related
Feb 12, 2011
I'm trying to execute the following command within a bash script:
Code:
tac /var/log/system.log | head -1
The script I wrote is:
[code]...
View 1 Replies
View Related