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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Solaris
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Solaris
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
rdump(8c) rdump(8c)
Name
rdump - file system dump across the network
Syntax
/etc/rdump [ -key [ argument ... ] filesystem ]
Description
The command copies to magnetic tapes, disks, or a dump image file all files changed after a certain date in the filesystem. The command is
identical in operation to except the f key must be specified and the file supplied should be of the following form:
remote-system-name:device-or-file
The command initiates a remote server, on the remote system to access the remote device or file.
Options
With the command, you specify a string of one or more of the options described below. If no options are specified, the key 9u is assumed.
0-9 This number is the ``dump level.'' All files that were modified since the last date stored in the file for the filesystem at
lesser levels will be dumped. If no date is determined by the level, the beginning of time is assumed. Thus, the level 0 causes
the entire filesystem to be dumped, a level 5 is used for a weekly backup and a level 9 for a daily backup.
B The next argument is a number that specifies the size, in 1024-byte blocks, of a storage medium, such as a diskette or a removable
disk. See the first example.
d The density of the tape, expressed in bits per inch, is taken from the next argument. This density is used in calculating the
amount of tape used per reel. The default density is 1600 bpi.
f Place the dump on the file or device specified by the next argument. This file is specified as remote-system-name:device-or-file.
n Notify, by means similar to a command, all users in the group ``operator'' when needs operator attention.
o Provides compatibility with non-ULTRIX or pre-ULTRIX Version 2.0 remote systems.
S Displays amount of space used by without performing the dump operation. This is used for presizing either for file preallocation
or to ensure the correct number of tapes or disks are on hand.
s The next argument specifies the size of the dump tape (in feet). When the specified size is reached, waits for the reel to be
changed. The default tape size is 2300 feet.
u If the dump completes successfully, writes the date of the beginning of the dump to file This file records a separate date for each
filesystem and each dump level. The format of consists of one free format record per line: filesystem name, increment level and
format dump date. The superuser can carefully edit to change any of the fields.
W The utility tells the operator what file systems need to be dumped. This information is taken from the files and The option causes
to print out, for each file system in the most recent dump date and level, and highlights those file systems that should be dumped.
If the option is used, all other options are ignored, and exits immediately.
w Unlike lists only those filesystems that need to be dumped.
Examples
This example reports number of bytes to be output for a level 0 dump of the root file system. Please note: the file is not created.
rdump OSf system:test /
This example dumps the root(/) file system from the local system to a remote system named ``nihil''. A level 0 dump to tape is performed
and the file is updated.
rdump 0uf nihil:/dev/rmt0h /
This example dumps the user (/usr) file system from the local system to a remote system named ``dickens'' using the RX50 device named for
output. A level 0 dump is performed, but the file is not updated.
rdump 0f dickens:/dev/rra1a /usr
This example dumps the root file system to a non-ULTRIX or ULTRIX before Version 2.0 remote system. A level 0 dump to a tape drive is per-
formed and the file is updated.
rdump 0ouf system:/dev/rmt0h /
This example dumps the root file system to a non-ULTRIX or ULTRIX before Version 2.0 remote system. A level 0 dump to the rx50 device is
performed and the file is updated. Note the specification of 400 as the device size in 1,024 byte blocks.
rdump 0ouBf 400 system:/dev/rra1a /
If you want to use / and you must have these entries in the file.
Diagnostics
Same as with a few extra related to the network.
Files
Required for user interface
See Also
dump(8), rmt(8c)
rdump(8c)