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


ADVERTISEMENT

General :: Shell Script Execution On Double Click?

Feb 27, 2010

I could run the script from terminal. My script invokes some installation and works fine.But my wish is that end-user should double click the sh script and it should run.But how? I got few links - but none was of was quite helpful

View 6 Replies View Related

General :: SSH Command Mode - Flow Of Execution Returns To Bash Shell

Aug 13, 2009

I want to use ssh to execute a command and to wait endlessly to log everything (in file) that comes as a stream of the connected server. But unfortunately, in the manual its written "If command is specified, it is executed on the remote host instead of a login shell"

So what happens is that when I specify my command:
ssh user@server "my_command"

It executed the command and the flow of execution returns to bash shell. So basically my session ends right after the command is executed. This happens only in case I specify command in the command line. If I login into ssh manually and then type "my_command", then the session doesn't end. I want the ssh not to exit, because after "my_command" executes, I want to capture everything in the session.

View 3 Replies View Related

Security :: SSH For Remote Execution?

Feb 8, 2011

We are on our first Linux platform and I am trying to coordinate a distributed application backup across multiple machines. I am trying to write a script in which I would have used RSH to execute scripts on the other servers. We are no longer allowed to use rsh, and someone suggested ssh. I am using that instead of telnet, but I am not sure of the syntax"rsh server [-n] path/executable" is what I would have used, just not sure of the syntax for ssh

View 8 Replies View Related

General :: Remote Command Execution Via SSH And Newgrp Command?

May 9, 2011

Up until now I've been using plink to remotely compile a project I'm working on. But recently the administrator from the remote server updated the distribution and messed up some configurations. My project has a lot of scripts written for tc shell (tcsh), and now the default shell is bash. There is no way to change this. Another problem is that now I need to run newgrp to change my default user group.

So... to work around this problem I've changed my .bashrc to run newgrp and then tcsh. If I do a normal connection using SSH, everything works as expected, but when using plink, or SSH to remotely execute commands, the shell gets stuck on the newgrp command. I think it's because both applications need a return value from newgrp to send the command I need to execute. Remotely running scripts that call a shell also get stuck like newgrp (newgrp also opens a new shell and that's why it gets stuck) my .bashrc is as follows:

Code:

user_grp=`id -g`
if [ $user_grp != 4919 ]; then
newgrp new_group_id
else

[code]....

View 4 Replies View Related

Software :: Escape Command For Remote Ssh Execution?

Jun 14, 2010

I have the following command:

Code:

(systool -c fc_host -v && systool -c fc_remote_ports -v) | grep -E '+Class Device path = "/sys/class/fc_host/host[0-9]+"$|+node_name.*= "0x[0-9a-f]{16}"$|+Class Device path = "/sys/class/fc_remote_ports/rport-[0-9]+:[0-9]+-[0-9]+"' | sed -e 's#.*host([0-9]*).*"#scsi-qla1-adapter-node=#' -e 's#.*rport-([0-9]*):[0-9]*-([0-9]*).*#scsi-qla1-target-2=#' -e '$!N;s#
##' -e 's#=.*node_name.*= "0x#=#g' -e 's#"$#;#g' | sort

and I want it to execute via ssh on a remote machine through a script. Therefor I need to escape it properly. Because of the massive use of regular expressions and commandline options, this is not an easy task. Is there any (online) utility that will escape that for bash use? I suppose pasting the code in vi and doing some search and replaces should do the trick. But for that I would need a list of characters to escape...

View 2 Replies View Related

Programming :: Control Execution Of Programs In A Shell Script?

Apr 27, 2010

Do you know how to write a shell script that executes say 4 instances of the same program in different directories at the same time, and once ONE instance completes it executes a new instance of that program in a new directoryd so on, until 100 instances have been executed, each in their own directory

View 5 Replies View Related

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"
else

[code]....

View 12 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..

Code:

if [ $1=$anyvariable ]; then
ssh www.a.com <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)

e.g.

if
my_code.sh &
#jobs
[1]- Running my_code.sh &

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 :: 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

Fedora Installation :: Run A Shell Script From A Remote File?

Oct 4, 2009

if I wanted to run a shell script from a remote file (say on my desktop) in which when clicked the file the shell script would run how would I do so?In other terms, the file would contain the command: sh /home/Phobos/Documents/jes-4-2-2-nojava/JES.sh

However what extension should the file have in order to run on click?

View 5 Replies View Related

Programming :: Write Shell Script To Ssh Into A Remote Computer And Run That?

Jun 26, 2010

How do i write a shell script to ssh into a remote server with password and run a script in it?

View 2 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 :: Set The SGE Job Execution Order?

Jun 22, 2010

I am trying to write a script to set the SGE job execution order. I named each job with 'job1', 'job2' and 'job3'. I want my script to do: When 'job1' execution is complete, 'job2' is executed; when both 'job1' and 'job2' are complete, 'job3' is executed.

First, I tried this following script and it worked well:

########
qsub -N job1 run1.sh # run1.sh includes "mv file_name1 file_name2"
qsub -N job2 -hold_jid job1 run2.sh # run2.sh includes "mv file_name2
file_name3"
########

[Code]....

View 7 Replies View Related

General :: Execution Time In A C Program ?

Jan 10, 2010

I need to find out the processing or operating time in milliseconds or in nanoseconds for the instructions or for the whole process!

for eg :

I need to calculate the time taken to execute :

And i dont want the time for whole program :

View 4 Replies View Related

General :: Repeating The Command After One Execution?

Oct 13, 2010

I have seen command like $rm aa dd cc bb ee then something like $ >> zz // it removes zz also Where aa dd cc bb ee zz are the files in my directory. Do not know exactly.

View 6 Replies View Related

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 :: Script Execution Flow Stopped?

Apr 1, 2010

Now my script is able to start server, But I am still have some problem with my script. When the start server command is executed, the control does not pass the line and does not execute further of that line.what is the problem and how can I get smooth execution of the my script. My Script:

SUBIT="su - adminuser -c "
SERVER_BOX_COMMAND_A="Server"
##############

[code].....

View 1 Replies View Related

General :: Chroot For Unsecure Programs Execution?

May 13, 2010

I have never set-up a chroot-jailed environment before and I am afraid I need some help to do it well.To explain shortly what this is all about: I have a webserver to which users send python scripts to process various files that are stored on the server (the system is for Research purpose).Everyday a cron job starts the execution of the uploaded scripts via a command of this kind: /usr/bin/python script_file.pyAll of this is really insecure and I would like to create a jail in which I would copy the necessary files (uploaded scripts, files to process, python binary and dependencies).

I already looked at various utilities to create jails but none of them seemed up-to-date or were lacking solid documentation (ie. the links proposed in How can I run an untrusted python script)Could anyone guide me to a viable solution to my problem? like a working example of a script that creates a jail, put some files in it and executes a python script?

View 2 Replies View Related

General :: Measure Script Execution Time?

Jan 4, 2011

In bash shell, is there a simple way for me to monitor the time taken to run a script and output the time taken?

View 1 Replies View Related

General :: Remove Execution Permission For Users?

Apr 2, 2010

I am using CentOS release 5.4 ( 2.6.18-164.9.1.el5xen ) and created an HPC cluster by using NIS ( for user authentication ) NFS ( as file system ) and mpich1 as parallel compilers and utilities and TORQUE as job scheduler. I want to make sure all users should use scheduler for job submission and should not submit the job directly ( qsub job.sh ).

I want to prevent all users from executing executable files created by self , from its home directory .

Suppose if a user create an executable a.out and if he tries to execute by ./a.out it should display an error.We should also allow users to execute normal user level linux commands .How can I implement such a set up in my environment

View 5 Replies View Related

General :: Receive Emails About A Cronjob Execution?

Jun 15, 2011

how I can receive emails about a cronjob execution or where to go to read about that? I am using CentOS 5.4.

View 2 Replies View Related

General :: Decrease The Cpu Load During Qemu Execution?

Aug 8, 2011

is there any way to decrease the cpu load during qemu execution?

View 5 Replies View Related

General :: Virtual Addresses Accessed By An App During Its Execution?

Mar 17, 2010

Get the list of virtual addresses being accessed by any application during its execution time. I don't want the complete memory map but just the pages which were accessed during an application's execution?

View 2 Replies View Related

General :: Wget Is Creating File For Each Execution?

Dec 1, 2010

I am calling a service using http post through wget, the command is successfully executing but for each execution its creating a file and saving variable names n data n it. I want to execute this command without creation of a file. Would anyone suggest me what needs to be done in this regard.

My command:
wget --post-data 'var1=99&var2=200' http://xyz.example.com:5555/invoke/Samples:httpInvoke
For every execution, its creating the files with names:
Samples:httpInvoke1
Samples:httpInvoke2
Samples:httpInvoke3

[Code]...

View 1 Replies View Related

General :: Get Virtual Addresses Accessed By An Application During Its Execution?

Mar 17, 2010

How to get the list of virtual addresses being accessed by any application during its execution time. I don't want the complete memory map but just the pages which were accessed during an application's execution?

View 2 Replies View Related

General :: How To Loop A Script Execution With Param From A Text File

Aug 14, 2010

I need to run ./pythonScript keyword one time for each keyword in a text file, how can I do this from a gnome terminal? (without having to modify the pythonScript)

pseudo code:

for each keyword in file:
./pythonScript keyword
waitfor(pythonScript to finish)

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved