General :: Check If Remote Server Is Up - Shell Script?

Sep 10, 2010

I need to add something to an existing shell script that will check whether a remote server is up or not.basically (but I can't figure it out) :-

if [ -the server to check- ] ; then
echo "Server is Up"


View 12 Replies


Programming :: Shell Script To Check Whether Directory Exists On Remote Server

Jan 17, 2011

I am new to scripting, would like to have a script that tests whether a directory exists on remote host & display the message accordingly. The remote hostname can be provided by means of file containing list of hostnames. Can use rsh for connecting to remote host.I tried with couple of scripts by searching google but didn't get desired result. Please help me, below is my efforts, $file contains list of hostnames.

View 10 Replies View Related

General :: Shell Script To Check Whether Mysql Server Is Running Or Not

Apr 27, 2009

from nmap localhost | grep mysql command i will come to know whether mysql server is running or problem is i want to test whether mysql server is running or not in shell script and if it is running i need to tell the user to stop the server to run the shell script.

View 3 Replies View Related

General :: Delete A File On A Remote Server Using Shell Scripting?

Jul 18, 2010

delete a file on a remote server using shell scripting.

View 14 Replies View Related

General :: Write A Shell Script Which Can Ready Content Of The Folder And Place Files On Remote FTP Server?

May 9, 2011

I need to write a shell script which can ready content of the folder and place files on remote FTP server. I need to make sure that a file that is already placed on remote FTP server is not attempted second time. The file names will be something like Records-2011-05-09. The files will be generated by MySQL every hour.

View 7 Replies View Related

Server :: Write A Shell Script Which Will Check IP And Domain Name In Rbl?

Feb 12, 2011

i am trying to write a shell script which will check my IP and domain name in rbl and inform me if it is listed.

View 4 Replies View Related

Software :: Running X-Server From Remote Shell Session?

Apr 7, 2010

How do I obtain information about the running x-server from a remote shell session? I want to know things like resolution, color depth, etc. My xorg.conf is basically empty. The only thing I can think of doing is to read the Xorg.0.log file which seems inefficient.

I thought that 'xrandr' displayed some text output but that behavior has changed (?). It seems to require an X display. Is there another way? Something I could incorporate into a shell script? (This is Fedora but that shouldn't really matter)

View 1 Replies View Related

General :: Check Status Of A Shell Script?

Aug 2, 2010

I'm running CentOS 5.5 and have created an init script. The start of the script contains:

# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions

The start bit works fine, but I'm having problems with the status and stop part:

echo -n "Status of script: "
status "/bin/sh /path/to/"

In PS AUX the command appears as "/bin/sh /path/to/" and I can see the PID. But when I run:

./my_init_script status

It says the script is not running. Should I be using the /bin/sh bit, or just the full script path, or just the script filename?

The stop part of the init script utilises "killproc". Again what command should I be using to successfully kill all occurrances of the script?

View 1 Replies View Related

General :: Shell Script To Check If Rpms Is Installed Or Not?

May 1, 2010

i have a input text file contain 10 rpms and they are old versions i need a shell script to check if these rpms is installed or not and if the newer version is installed and i need all the results in one output text file contain every rpm and its condition ( the same) or (new )or( not installed)

View 3 Replies View Related

General :: How To Check Folder If It Has Files In It Using Bash Shell Script?

Aug 4, 2010

there is a folder. Its empty. When every I drag a new file and put into it it echo out "there is file in there" and keep monitoring the folder. How can I do it?

View 7 Replies View Related

General :: A Shall Script For Remote Shell Execution?

Mar 26, 2011

i need to take the backup some folders encryption formate with password i used gpg encription in the script but it is not taking the password it throos errorthe syntax is#!/bin/bashtar -cvzf test.tar.gz target ; echo "test" | gpg -c test.tar.gz --stdin

View 3 Replies View Related

General :: Write Shell Script To Check The Modified Date Of A File ?

Jun 17, 2011

I have two linux servers, they are backup together.

1. Server 1 have 3 files with name: file1, file2, file3 in the path: /etc/sysconfig/network-script/.

2. Server 2 have 3 files with name and path are the same as server 1.

- How to make a script to copy 3 files at server1 to overwrite on server2. But before overwrite, this script will check and compare the last modified date of these 3 files(on server1 and server2). if the modified date of file1, file2 or file3 on server1 is newer than 3 files on server2 then overwrite process will do, if not, will do nothing.

- see my script as below: it works find now but just overwrite. not check last modified date.

View 1 Replies View Related

General :: Detect Remote Logins Within Shell Script?

Apr 19, 2011

I've written a shell script that among other things, restarts network services. As such, I'd like to keep those who are remoting in via putty, etc. from executing the script. Is there a way to detect this and restrict running the script (by adding additional coding in the script) that disallows running it from unless you are logged in directly to the machine? It's written in bash.

View 1 Replies View Related

General :: Use Ssh And Run Command In The Remote Machine Using Shell Script?

Apr 27, 2011

How can i do that.. Today is my first day writing a script.. and correct me if this Thread should be somewhere else..


if [ $1=$anyvariable ]; then
ssh <Have to set few variables and give commands >

View 8 Replies View Related

General :: Move A Process From One Shell To Another (local To Remote)?

Jan 28, 2010

Is is possible to move a process from one shell to another (local to remote)


if &
[1]- Running &

was started on one remote shell is it possible to move it to the foreground on another shell as root or another user?

View 5 Replies View Related

General :: Shell Script With Java Which Check The Disk Space And Send Mail To Id?

Jun 14, 2010

i want to write the script which check the disk space of linux server and send me the disk space details and mail me on my id.

View 2 Replies View Related

General :: Bash Shell Script To Check / If Empty Files Are Being Created & Start Process

Jun 25, 2010

I have an Ubuntu server in which a file is dumped every hour and a new file for the next hour and the process continues. If there is any problem due to which the creation of file stops then empty files are created every minute till the process is killed & started again. I need help to make a shell script to check if the empty files are being created and then kill the process and start it again.It would be a great help if anyone can help me regarding this.

View 9 Replies View Related

Ubuntu Servers :: Machine Shadowing Crashes With Message "The Connection With Remote Server Was Shut Down, Please Check Your Network Settings And Try Again."

Sep 5, 2010

I am using debian testing on my office pc, but i need to access it's desktop from time to time. So i need No machine/teamviewer software that can provide me with possibility to interact my desktop. The problem is, that i want to run shadowed session type, because teamviewer is not good for me. So, when i run no machine in shadowed mode, it crashes with message "The connection with remote server was shut down, please check your network settings and try again." The log is here:


View 1 Replies View Related

Security :: Check The Listening Url In The Remote Machine?

Jul 8, 2010

I have stuk up in big issue here , I just want to find the remote url in which it listens ?

I know the remote host and remote port number but i just want to which url the web application listen

For example : Host : & port no : 8080

But i remember the url would be

I want to find the complete url in which it listens ?

In nmap whether i can achive this or anyother tool ?

View 5 Replies View Related

Fedora :: Transaction Check Error With Gnome-shell

Mar 25, 2011

How do I resolve the transaction check error?

View 9 Replies View Related

Programming :: Check If Directory Exists Using Shell Script

Apr 20, 2009

I am trying to write some small script file that will check if a USB stick is connected to my pc or not. I can't seem to get it to work, but I am sure it is a very simple fix.

I am running on Fedora core 10.Can anyone help me figure out what the problem is?If I run these lines through console it works fine (meaning, I type the commands in this file straight in the command line/console).

View 9 Replies View Related

Programming :: Shell Script / How To Check File Size?

Jan 21, 2009

I have a file that's supposed to be growing in size 24/7. I want to check every 10 minutes via cron that it's actually growing. If not, send an email. Does anyone know how to write a script to do that?

View 3 Replies View Related

Programming :: Possible To Check Which Window Has Focus Using Shell Script

Nov 7, 2009

I'm playing a game through wine (fullscreen), when I alt-tab back to my ubuntu desktop, the resolution doesn't change back, but stays at the game resolution.I'm currently using a shellscript that changes the resolution back to my origional resolution (using xrandr -s 0)

Is it possible to check which window has focus using a shellscript.If the game doesn't have focus change resolution to my origional resolution.

View 3 Replies View Related

General :: Access Remote Mysql Server Through Socks Proxy Server?

Aug 25, 2010

Scenario:A - Local Unix machineB - socks proxy server port 1080C - remote mysql server port 3306I want to connect to the remote mysql server(C) from local unix machine(A) using sock proxy(B).

View 1 Replies View Related

General :: Setup Remote Access Server On Red Hat Enterprise Server Release 5.1?

Aug 30, 2009

how i have a machine installed Red Hat Enterprise Linux Server release 5.1 with 2 modem (usb & com port) still i want to configure RAS server so some pple able to connect my server and send me some files.

View 4 Replies View Related

General :: How To Check Which Web Server Is Installed In Server

Mar 25, 2010

I have developed a small website using jspx pages.Now i want to host the website to a server which is a linux machine.The linux machine which i m referring to is already hosting some web pages(jspx) through a web server Which is running at port 8888.My first question would be "How would i check which web server is installed in the server?"Due to my little knowledge about linux machine .I have copied some simple html pages to /var/ www/ html location. The pages are getting accessed correctly on port number 80.But how would i go about hosting jspx pages.

View 13 Replies View Related

General :: Check Another Server - If Down Then Do Something

Oct 18, 2010

I'm looking for an easy way to check if some server is down, and then act upon it. This check needs to be done from the backup-server. So if the backup-server thinks the production server is down, then in some bash script I want to execute a rule.

My question: what is an easy way to check another server ?
1. I know about Nagios. It's great, but to large to use here.
2. I could ping the server, put a ping that fails does not necessarily mean the server is down.

View 6 Replies View Related

Programming :: Write A Shell Script Which Will Check A File Name In A Dir And Copy It?

Apr 2, 2010

I am a novice to the shell script. In my system from db server the log files are enerating with the name log1.txt,log2.txt..... It is capable of keeping 10 files at a time in dir called /db/sis/log1.txt. I want to copy the log1.txt to another directory when ever it generating by attaching the time stamp to it for the back-up purpose. this files will be there for a period of 24 hours. after that the back-up dir should be cleared and it start copying again the fresh file from the same dir.

View 3 Replies View Related

Hardware :: Check HP CP-1215 Toner Levels From A Remote Machine?

Dec 2, 2010

HP's apparently all but useless Linux site suggests that their hplip drivers give you that capability. However, it also seems to expect that I will be running a GUI to use their tools.

My CP-1215 is attached to my server which doesn't have a GUI installed.

Previously I'd been using the open source CUPS driver, which seemed to work pretty well. However, I recently ran low on one colour of toner which messed up the printing. The toner-out lights on the printer never cam one, so replacing the toner cartridge was not the first thing I tried to fix it.

I've just installed the hplip / hp-plugin driver which also seems to be working. However, the CUPS web interface doesn't allow me to retrieve the toner status.

Has anyone had any luck retrieving the toner levels from an HP colour laserjet printer?

View 3 Replies View Related

General :: How To Connect To A Remote Server And Run Some Code On That Particular Server

Jun 30, 2011

I am implementing an automated backup scheme so I created a shell script which first creates SQL dumps for all MySQL databases, then retrieves all websites from the /var/www directory of a remote server. The latter is working as I am using rsync to get the remote files.However, the MySQL dumps being retrieved are the ones from the local server which is not what I want. I want to get the SQL dumps from the remote server as well.I have a tunnel between the local and remote server which I can connect to without using any password (I added the public key to the authorized_hosts), so I tried to add the following code to the script:


I then attempted to retrieve the SQL dumps and exited from the remote server. However this does not work as I still have to enter exit manually in the terminal for the SQL dumps to be retrieved from the remote host. I don't know why this is happening. This is what the script is trying to do:

//connect to remote server
//retrieve SQL dumps


Is there a way to connect to the remote host AND run the script's code on THAT remote host?

View 2 Replies View Related

Copyrights 2005-15, All rights reserved