Operating System - Linux
1823113 Members
3332 Online
109646 Solutions
New Discussion юеВ

Re: how to copy updated files to the server automatically

 
Maaz
Valued Contributor

how to copy updated files to the server automatically

Hello Dear Gurus
there is a directory "/project" on a server(10.1.1.9).
I also have copy the "/project" directory from 10.1.1.9 to another server(10.1.1.10).
Now I want that whenever any file in /project/ directory on 10.1.1.9, updates/modified that file also automatically copies to the "/project" directory of 10.1.1.10
I know how to use 'scp', but what should i do, so that updated files will be automatically copied to the destination.

Regards
Maaz
5 REPLIES 5
Ivan Ferreira
Honored Contributor

Re: how to copy updated files to the server automatically

I think that is better if you use rsync.

The rsync service can copy only files that where modified, so you can run a "cron" to continuously copy the files, but only the modified files will be copied.

There is also the posibility to run RAID on network block devices (NBD), to mirror the data.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rick Garland
Honored Contributor

Re: how to copy updated files to the server automatically

rdist or rsync are better choices for this task.

Maaz
Valued Contributor

Re: how to copy updated files to the server automatically

Dear Ivan, and Rick Garland Many Thanks for the help.

1, Dear Ivan, and Rick what rpm should i have to install to work with rsync ? i m using rhel 3.0.
2, I dont know how to configure the rsync.. if u can plz guide me, i'll be highly thankfull to u all.
And if u can plz write me the syntax of cron, for my situation/scenario ?

Thanks n Regards
Maaz
Rick Garland
Honored Contributor

Re: how to copy updated files to the server automatically

rpm -qa | grep -i rsync

I have the version rsync-2.6.3-1 installed.
You should get a return to the rpm command if the utility is installed.

As to cron
minutes hours day-of-month month day-of-week

So...
00 05 15 8 *
Says that at 0500 hrs on the 15th day of the 8th month

Not knowing what it is you are trying to accomplish, I would direct you to the man pages (man rsync) There are examples in the man pages that can help.





Ivan Ferreira
Honored Contributor

Re: how to copy updated files to the server automatically

The configuration is easy (much like like sama), is better if you find in google a tutorial, because has several options.

Rsync works with a daemon, and a client that is the rsync command itselv (rsync -avz).

It uses rsh commands, so if you want security, find a document that describes how to use rsync with ssh.

Regards.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?