Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Running scripts from different server Post 302771251 by chococrunch6 on Wednesday 20th of February 2013 05:23:27 AM
Old 02-20-2013
Running scripts from different server

Hi,

I need a script (ksh) on ServerAdmin that will run an archive scripts from different several Servers through ssh. The problem is that how can i switch user when before running the archive script. I already configured password-less connection on the servers.

Code:
server 1
/usr/bea/home/domain1/scripts/archive1.sh ; switch user to domain1

server 2
/usr/bea/home/domain2/scripts/archive2.sh ; switch user to domain2

server 3
/usr/bea/home/domain3/scripts/archive3.sh ; switch user to domain3

server 4
/usr/bea/home/domain4/scripts/archive4.sh ; switch user to domain4

thanks!

Last edited by chococrunch6; 02-20-2013 at 06:34 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Running shell scripts on a remote server

Hi - I am running Mac OS X (Terminal) at my current workstation, and I would like to telnet to my local server to run a shell script. The local server is a Solaris machine (don't know the version or the type of Unix being run on it, sorry.) The problem I have is that when I create a #!/bin/sh... (2 Replies)
Discussion started by: pepintheshort
2 Replies

2. UNIX for Dummies Questions & Answers

Running scripts from home

I have created a Bourne shell script that helps with metric counting and it has to be run in a ClearCase view. It has been placed in a directory where if User A cd'd to it and runs it, a bunch of errors occur. Because this is a tool that several users would want access to and the program assumes... (2 Replies)
Discussion started by: mastachef
2 Replies

3. Shell Programming and Scripting

Running scripts in parallel

Hi, Iam having the scripts as follows. i jus want to run those in parallel. main aim is to minimise the time for overall execution of the script. now out.txt is having 1 lac records. script1(split.sh) split -1000 out.txt splitout ls -A splitout* > filelist.txt cat filelist.txt... (6 Replies)
Discussion started by: nivas
6 Replies

4. Shell Programming and Scripting

Running scripts through cronjob.

Hello everybody, I'm trying to run a shell script in crontab file. But anyhow it's not getting executed. Following is the command that I've used in crontab. 30 07 * * * . ./.cronprofile;/om/reports/reportscripts/jitu/prod/prd_pre_to_post.sh 35 11 * * * .... (3 Replies)
Discussion started by: jitu.jk
3 Replies

5. Shell Programming and Scripting

Running scripts unattended

Hi guys just wondering how i could make one of my scripts run unattended without the use of cron? (3 Replies)
Discussion started by: musicmancanora
3 Replies

6. Shell Programming and Scripting

Running scripts via su

Hi All, Am using the below command to start my application using the root user su - bin -c "/home/bin/test/start.sh" but am getting the error becaue i have set some environment varibales in bin .profile when i execute the command start.sh by logging directly into bin account it's... (8 Replies)
Discussion started by: ravi.sri24
8 Replies

7. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

8. Shell Programming and Scripting

Running 2 scripts one after the other using cron

I would like to run two scripts using cron one immediately after the other. Is it enough to put them one after another in the cron file to run at the same time, or will this cause them to run concurrently? (4 Replies)
Discussion started by: 3210
4 Replies

9. Shell Programming and Scripting

running scripts in minicom

Hi, I am new to use minicom. I want script to run on minicom with username and password as automated.(Expect). please could anyone suggest the sample code for it. Thanks in advance (2 Replies)
Discussion started by: vanid
2 Replies

10. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies
MOLLY-GUARD(8)							  [FIXME: manual]						    MOLLY-GUARD(8)

NAME
molly-guard - guard against accidental shutdowns/reboots SYNOPSIS
shutdown [-hV] [--molly-guard-do-nothing] [-- script_options] halt [-hV] [--molly-guard-do-nothing] [-- script_options] reboot [-hV] [--molly-guard-do-nothing] [-- script_options] poweroff [-hV] [--molly-guard-do-nothing] [-- script_options] DESCRIPTION
molly-guard attempts to prevent you from accidentally shutting down or rebooting machines. It does this by injecting a couple of checks before the existing commands: halt, reboot, shutdown, and poweroff. This happens via scripts with the same names in /usr/sbin, so it only works if you have /usr/sbin before /sbin in your PATH! Before molly-guard invokes the real command, all scripts in /etc/molly-guard/run.d/ have to run and exit successfully; else, it aborts the command. run-parts(1) is used to process the directory. molly-guard passes any script_options to the scripts, and also populates the environment with the following variables: o MOLLYGUARD_CMD - the actual command invoked by the user. o MOLLYGUARD_DO_NOTHING - set to 1 if this is a demo-run. o MOLLYGUARD_SETTINGS - the path to a shell script snippet which scripts can source to obtain settings. molly-guard prints the contents of /etc/molly-guard/messages.d/COMMAND or /etc/molly-guard/messages.d/default to the console, if either exists. This is due to /etc/molly-guard/run.d/10-print-message. GUARDING SSH SESSIONS
molly-guard was primarily designed to shield SSH connections. This functionality (which should arguably be provided by the openssh-server package) is implemented in /etc/molly-guard/run.d/30-query-hostname. This script first tests whether the command is being executed from a tty which has been created by sshd. It also checks whether the variable SSH_CONNECTION is defined. If any of these tests are successful, test script queries the user for the machine's hostname, which should be sufficient to prevent the user from doing something by accident. You can pass the --pretend-ssh script option to molly-guard to pretend that those tests succeeds. Alternatively, setting ALWAYS_QUERY_HOSTNAME in /etc/molly-guard/rc causes the script to always query. The following situations are still UNGUARDED. If you can think of ways to protect against those, please let me know! o running sudo within screen or screen within sudo; sudo eats the SSH_CONNECTION variable, and screen creates a new pty. o executing those command in a remote terminal window, that is a XTerm started on a remote machine but displaying on the local X server. You have been warned. You can use the --molly-guard-do-nothing switch to prevent anything from happening, e.g. halt --molly-guard-do-nothing. OPTIONS
--molly-guard-do-nothing Cause molly-guard to print the command which would be executed, after processing all scripts, instead of executing it. -h, --help Display usage information. -V, --version Display version information. SEE ALSO
shutdown(8), halt(1), reboot(8), poweroff(8). LEGALESE
molly-guard is copyright by martin f. krafft. Andrew Ruthven came up with the idea of using the scripts directory and submitted a patch, which I modified a bit. This manual page was written by martin f. krafft madduck@madduck.net. Permission is granted to copy, distribute and/or modify this document under the terms of the Artistic License 2.0 COPYRIGHT
Copyright (C) 2008 martin f. krafft [FIXME: source] Apr 19, 2008 MOLLY-GUARD(8)
All times are GMT -4. The time now is 09:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy