LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-02-2009, 06:45 PM   #1
Betzie
LQ Newbie
 
Registered: May 2008
Location: UK
Distribution: CentOS 4.6
Posts: 9

Rep: Reputation: 0
Bash Script to log off of ssh connection


Hi -

I have been using the command line on a slave server to synchronize dns files from a master server using the following (there is an ssh key relation between the two):

rsync -e ssh -avz --delete-after user@masterserverIP:/etc/named.conf /etc/
rsync -e ssh -avz --delete-after user@masterserverIP:/var/named/* /var/named/

However, after running the above commands, I need to then reload BIND on the slave.

Can anyone point me towards the syntax of how I might do this with a bash script?

I hope this makes sense....

Thanks in advance for any advice.
 
Old 07-02-2009, 08:38 PM   #2
internalkernel
LQ Newbie
 
Registered: Jun 2009
Location: /dev/null
Distribution: Jaunty 9.04
Posts: 15

Rep: Reputation: 0
I'm not entirely sure what you mean, but I'll give it a shot...

reloading bind from the command line, should be as simple as

Code:
/etc/init.d/bind9 restart
that seems so simple, that I'm sure you mean something else.

Is this all part of a current script? or are you trying to write one? An rsync script is usually rather simple, that's how I run backups on my server as well... let me know if I can be of any more help...
 
Old 07-03-2009, 01:49 AM   #3
Betzie
LQ Newbie
 
Registered: May 2008
Location: UK
Distribution: CentOS 4.6
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by internalkernel View Post
Is this all part of a current script? or are you trying to write one?...

Thank you and sorry for the lack of clarity - yes, I was trying to come up with a script.

Thanks again,
B.
 
Old 07-06-2009, 02:01 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Why aren't you letting bind do this? Its part of its functionality:

http://www.linuxtopia.org/online_boo...namedconf.html

allow-transfer, masters
 
Old 07-07-2009, 04:29 PM   #5
Betzie
LQ Newbie
 
Registered: May 2008
Location: UK
Distribution: CentOS 4.6
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
Why aren't you letting bind do this? Its part of its functionality:

http://www.linuxtopia.org/online_boo...namedconf.html

allow-transfer, masters

Thanks - I've used this before but it does not save any time.

Unless I missed something, you still need to create the slave zone on the secondary, only after which the transfers will occur.

Beyond this, using my current routine, I can also update changes to any other zones that have occured, as well as delete zones that have been deleted from the primary.

When trying below:

rsync -e ssh -avz --delete-after user@masterserverIP:/etc/named.conf /etc/
rsync -e ssh -avz --delete-after user@masterserverIP:/var/named/* /var/named/
service named restart

it reloads the master server.

Thanks,
B
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh - how to close connection from bash script babag Linux - Networking 7 05-30-2008 09:14 PM
log monitor bash script tronica Programming 5 05-14-2008 02:53 AM
how to log everything from a bash script to a file prodsac Linux - Server 2 04-15-2008 04:56 PM
Clean log bash script? QuarQuar Linux - General 4 10-27-2007 11:46 PM
Bash script for server log (namely var/log/messages) tenaciousbob Programming 17 05-24-2007 10:43 AM


All times are GMT -5. The time now is 01:29 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration