Operating System - Linux
1825930 Members
2885 Online
109689 Solutions
New Discussion

copy/update a file to different host

 
Pradeep_7
Occasional Advisor

copy/update a file to different host

Hi,

I have 2 redhat linux 6.2 machines. On 1 machine I have a log file, which need to be copied/updated all the time to the other machine when ever there are changes to the log file.

I think remote shell can do this. But, is there any other way to update/copy a file to an other machine/host all the time? Both the machines are on the same network.

By the way, are there any security problems/issues using remote shell??

Please some one help me.

thanks,
Deep.
6 REPLIES 6
Stuart Browne
Honored Contributor

Re: copy/update a file to different host

Yes, you can use something like 'rdist' or 'rsync', or even just simple 'rcp' or 'scp' to copy a file from one to the other.

Depending on how the log file is being generated depends on whether there is a better way however.

If the log is being generated by something which dumps to syslog, then you can use syslog to log that level of output to a @remote machine. This whould stop the need for copying between systems..

But given the lack of details, we can't really say much more.
One long-haired git at your service...
Pradeep_7
Occasional Advisor

Re: copy/update a file to different host

Hi,

Sorry for not providing much details before...

I have oracle running on the primary machine and the other machine have the oracle standy by server.

I primary machine passess the archive log files to standy by machine with some configuration parameters set on oracle.


But, I want to make a copy of the online redo log files created all the time by oracle... I want to keep this copy on the stand by machince.. . which would help me to use the online logs on disaster of my primary machine....

So, I would like to know some sort of mechanism to copy/update the file and maintain sync of the file... on 2 machines..

Both are running on REDHAT LINUX 6.2

So, RCP or SCP are the only best ways or any other alternatives...??

Please help!

Thanks,
Deep.
U.SivaKumar_2
Honored Contributor

Re: copy/update a file to different host

Hi,

Rsync is ideal candidate for your purpose.

http://samba.anu.edu.au/rsync/

regards,
U.SivaKumar

Innovations are made when conventions are broken
Benny Chandra
Occasional Advisor

Re: copy/update a file to different host

You can use NFS. Mount the file system of stanby host on primary host, then configure oracle to write the redo log to the mounted filesystem.
Steven E. Protter
Exalted Contributor

Re: copy/update a file to different host

There are huge problems using any r... protocol, rlogin, rsh, rmexec, rmesh

scp is the way to go.

Here is a document that tells how to get secure shell ssh, scp et all working between Linux/Unix boxes by generating and exchanging public keys.

Attached.

Steve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Trever Furnish
Regular Advisor

Re: copy/update a file to different host

Um, these aren't "normal" files here - we're talking about Oracle's online redo logs.

The redo logs are defined as a series of groups containing a series of members. Each group can have many members, all of which are identical. If you really want them to be mirrored at all times, then you can add a member to each group and store the new members on an nfs volume. Then if the local drives are lost, the members on the nfs volumes may still be available.

In practice though you're probably better off just keeping the additional members on additional local drives, since NFS may substantially slow your ability to write to the redo logs, which would in turn slow your ability to do any database work.

If you have any reasonable amount of database activity, rsync isn't likely to provide a speedup over a straight file copy since the entire file will have changed since the last rsync.

Are you rotating your redo logs based on time or size? If it's based on time that'll be easier to cope with, since you have a predictable time period when each log will be available to copy.

To the poster who said "all the r* commands have problems", note that rsync can use ssh as its transport protocol, negating the security problems associated with remsh, rexec, rsh, and rcp.
Hockey PUX?