In the Tips and Suggestion section there is a section where you can run a
script on a remote machine using ssh. The following, in part, is the
instructions.
The authentication is done automatically using a private key. First you have
to generate a keypair. I've done this by:
ssh-keygen -b 4096 -t dsa -f Bacula_key
This statement may take a little time to run. It creates a public/private
key pair with no passphrase. You could save the keys in /etc/bacula. Now you
have two new files : Bacula_key which contains the private key and
Bacula_key.pub which contains the public key.
Now you have to append the Bacula_key.pub file to the file authorized_keys
in the \root\.ssh directory of the remote machine. Then you have to add (or
uncomment) the line
AuthorizedKeysFile %h/.ssh/authorized_keys
to the sshd_config file on the remote machine. Where the %h stands for the
home-directory of the user (root in this case).
Assuming that your sshd is already running on the remote machine, you can
now enter the following on the machine where Bacula runs:
ssh -i Bacula_key -l root "ls -la" (THIS SHOULD BE ssh -i Bacula_key -l
root 192.168.1.1 "ls -la")
This should execute the "ls -la" command on the remote machine.
Now you could add lines like the following to your Director's conf file:
...
Run Before Job = ssh -i /etc/bacula/Bacula_key 192.168.1.1 \ (the quote
should be after the = sign)
"/etc/init.d/database stop"
Run After Job = ssh -i /etc/bacula/Bacula_key 192.168.1.1 \ (the
quote should be after the = sign)
"/etc/init.d/database start"
... "
Now the problem that I have is when I try to run my script to stop the
oracle database, for some reason it logs me out of the remote machine and
then runs the script. Here is what I have in my Job directive for a client,
RunBeforeJob = "ssh -i /home/oracle/Bacula_key -l oracle 159.71.39.55 \
/home/oracle/oracle_stop.sh >>
log_oracle"
The log results are,
BeforeJob: run command "ssh -i /home/oracle/Bacula_key -l oracle
159.71.39.55
/home/oracle/oracle_stop.sh >>
log_oracle"
15-Jun 09:50 nmc-sdca-mon1-dir: BeforeJob: Error 6 initializing SQL*Plus
15-Jun 09:50 nmc-sdca-mon1-dir: BeforeJob: Message file sp1<lang>.msb not
found
15-Jun 09:50 nmc-sdca-mon1-dir: BeforeJob: SP2-0750: You may need to set
ORACLE_HOME to your Oracle software directory
When I did some debugging, it seems to log me out of the remote machine
before running the script on the remote machine. I am wondering why?
Does anyone have any ideas?
What I want to do is to stop the Oracle database on a remote HP-UX machine
and then run a full backup and then restart the Oracle database.
TIA
Mike
--
View this message in context:
http://www.nabble.com/Backup-Oracle-on-remote-HP-UX-tf3929270.html#a11144084
Sent from the Bacula - Users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users