Calling a remote shell script and applying a DB dump


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Calling a remote shell script and applying a DB dump
# 1  
Old 02-05-2013
Calling a remote shell script and applying a DB dump

Hi All,

I have a requirement to call a remote shell script to apply a db dump. The remote shell script will reside in the /root/admin/bin directory and the database dump will be copied by the script from another area to /root/admin/var.

the script will then invoke mysql to apply the db dump.

1). Can I setup a ssh public/private key against a root user on the remote server or do I have a to create another user to own the script on the remote area as well as a directory to hold the dump also own by the same user.

I say this because I know that it is not possible to loggin to a server as root it has to be another user eg. fbloggs

2). In my remote shell I have various SQL operations as part of the dump is there a way to test the success of all SQL operations in a shell script sql block rather than applying a test against each individual SQL operation.

Many thanks
# 2  
Old 02-05-2013
Q: Since you are talking of DB, why is it you use a root account and not a user belonging to a DBA group?
If the sysadmin doesnt allow root loggin I find it a very bad idea to try to bypass (If I were the sysadmin you would no more have the right to connect at all...)
Many servers have ssh configured so root is not allowed to use ssh also...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Core dump in a simple shell script!

Hi I have a very simple shell script that is dumping core - testScript - #!/bin/ksh PROG=${0##*/} # basename if ; then print -u2 "Usage: $PROG filename" exit 1 fi MDY=$(date '+%m%d%y') if ; then cat ${1}.out >>${1}.${MDY} else cp -p ${1}.out... (5 Replies)
Discussion started by: nsinha
5 Replies

2. Shell Programming and Scripting

Triggering remote UNIX shell script from Remote desktop

I m trying to run a batch script in remote desktop which executes unix commands on the unix server...the problem is i wnt the output in HTML format.so in my batch script i m giving the cmd like ssh hostname path ksh HC_Report.ksh>out.html ...but it generates the HTML file in remote desktop .i... (2 Replies)
Discussion started by: navsan
2 Replies

3. Solaris

how to login with ssh to remote system with out applying the remote root/usr password

how to login with ssh to remote system with out applying the remote root/user password with rlogin we can ujse .rhosts file but with ssh howits possible plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

4. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

5. Shell Programming and Scripting

connect to remote server by applying password

Hi , I am new to shell script. I have to write a shell script which will login to remote server then check for the space there. There 50 remote ervers all are having different password. Could you please suggest me some way. I am working on solaris box. Thanks in advance (2 Replies)
Discussion started by: vikash_k
2 Replies

6. Shell Programming and Scripting

Calling another shell script

Hi there, I have an script reading content of a file and runs whatever command is specified there, as follows #!/bin/bash # Supposed to read from a file that commands are listed to be run # when the server starts for initialization CMD_FILE=/myScripts/startup/task2do.txt if ; then ... (2 Replies)
Discussion started by: james gordon
2 Replies

7. Shell Programming and Scripting

calling a script in remote server

Hi, I need to call a shell script present in the remote server from the shell sript in my server. Can any one help to do this ASAP... Thanks (1 Reply)
Discussion started by: Preet
1 Replies

8. Shell Programming and Scripting

Calling shell functions from another shell script

Hi, I have a query .. i have 2 scripts say 1.sh and 2.sh 1.sh contains many functions written using shell scripts. 2.sh is a script which needs to call the functions definded in 1.sh function calls are with arguments. Can some one tell me how to call the functions from 2.sh? Thanks in... (6 Replies)
Discussion started by: jisha
6 Replies

9. Solaris

Shell script to send email alert for core dump

Friends, I am in search for a shell script that is capable of running as a cronjob and have to send out an email when ever there is a CORE DUMP. Please post the hints to achieve my goal. Thanks in advance. (1 Reply)
Discussion started by: rtatineni
1 Replies

10. Shell Programming and Scripting

Calling shell script ?

hi friends, i'm new to unix and straight away i had to start with the script files. I've a script file which gets called from a menu item on a GUI. This script file again calls .awk file, in performing some tasks , which also generates certain files. I modified the files to generate some... (1 Reply)
Discussion started by: Ravi_Kandula
1 Replies
Login or Register to Ask a Question