Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Replication

Posted on 2004-04-30
10
Medium Priority
?
330 Views
Last Modified: 2010-04-20
Hi Experts,

How do I replicate my application located on IP1server ( /opt/myapp) to IP2server (/opt/myapp) ?

Thank you.
0
Comment
Question by:fpoyavo
10 Comments
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 10959993
There are several differnt ways - ftp,samba,nfs,uucp. What distro are the boxes running?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10960168
I have redhat 8. Both machines have samba (there is no nfs, ftp is installed).
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 10960305
Set up your application directory as a share in smb.conf Restart samba - service smb restart. In the other box create a mountpoint for it under /mnt, ie
mkdir /mnt/box1
Mount it with mount -t smbfs //machinename/sharename /mnt/box1
Go to /mnt/box1 and copy the files wherever you want.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 1

Author Comment

by:fpoyavo
ID: 10960404
What if I would replicate starting from root ? How it can be done ?
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 10960461
Set up root as a share. In the file /etc/samba/smb.conf of the server you want to copy files from add the following.

[root]
comment = root partition
path = /
browseable = yes
public = yes

Restart samba ie service samba (or smb) restart
From the other box issue the command mount -t smbfs //otherbox/root /mnt/yourmountpoint.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10961676
What happens if some directories already exist ?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10961683
Another thing I have noticed that some executables don't have X attribute after copied via samba. Why ? How to avoid it ?
0
 
LVL 40

Accepted Solution

by:
jlevie earned 2000 total points
ID: 10961984
In the general case transferring an application from one system to another via Samba is unlikely to work. File/dir ownership and permissions won't be preserved with a direct copy. It is possible to use Samba shares or FTP as a transport media by tar'ing up an application directory on one system, copying the tar image to the other, and upacking it there, something like:

1) On system A

# cd /opt
# tar cvzf myapp.tar.gz myapp

2) Use FTP or Samba to copy /opt/myap.tar.gz to system B and there execute:

# cd /opt
# tar xvpf /path-to/myapp.tar.gz

Note that this may not be completely successful if the application requires specific things (config files, data dirs, special user accounts) to exist outside of /opt/myapp. Any of that must also be copied and/or set up on the target system.
0
 
LVL 2

Expert Comment

by:patrick24
ID: 10968623
use rsync :)

cheers
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10975719
Do you have ssh installed then use scp its safer and easy just do like this:
scp (filename) user@(ip):(path)
and you are done if this must be made automatic just add the host_keys to the host then you dont have to put in a pass and can be run from for example cron.

/Rob
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question