Solved

Replication

Posted on 2004-04-30
10
323 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

829 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