Hi all, I would like to synchronize a part of the source file with a part of the destination file. In detail I would like to - synchronize a file on a remote host from line "n" onwards with the file content on the local host starting with line "n" in the file. - the firs "n" lines of the files on the local and remote host should not be changed. My questions are: 1) Is it possible to do this with rsync? 2) Has anyone done that before? 3) How can I do this/where can I get more information? Many thanks, Rolf This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 15 Oct 2002 21:20, rolf.hausammann@accenture.com wrote:> Hi all, > > I would like to synchronize a part of the source file with a part of the > destination file. In detail I would like to > - synchronize a file on a remote host from line "n" onwards with the > file content on the local host starting with line "n" in the file. > - the firs "n" lines of the files on the local and remote host should > not be changed.How about a shell script that split (1)'s the file into the unique part and the common part, rsync the common part, and cat (1)'s the file back together? Brad - -- http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9q/t2W6pHgIdAuOMRAsZgAKCEhgLZv8+WsoU/ozE5PwBHu+dyNgCfVq5q YfHgA7SZa0oGIBtCDRI/ldw=bFAj -----END PGP SIGNATURE-----
I think you'd best use a script to first split the two files, symc the truncated parts with rsync and merge them again afterwards. Rgds, Bart rolf.hausammann@acc enture.com To: rsync@lists.samba.org Sent by: cc: rsync-admin@lists.s Subject: synchronizing part of a file amba.org 10/15/2002 13:20 Hi all, I would like to synchronize a part of the source file with a part of the destination file. In detail I would like to - synchronize a file on a remote host from line "n" onwards with the file content on the local host starting with line "n" in the file. - the firs "n" lines of the files on the local and remote host should not be changed. My questions are: 1) Is it possible to do this with rsync? 2) Has anyone done that before? 3) How can I do this/where can I get more information? Many thanks, Rolf This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
On Tue, Oct 15, 2002 at 12:20:30PM +0100, rolf.hausammann@accenture.com wrote:> Hi all, > > I would like to synchronize a part of the source file with a part of the > destination file. In detail I would like to > - synchronize a file on a remote host from line "n" onwards with the > file content on the local host starting with line "n" in the file. > - the firs "n" lines of the files on the local and remote host should > not be changed. > > My questions are: > 1) Is it possible to do this with rsync? > 2) Has anyone done that before? > 3) How can I do this/where can I get more information?1) not without lots of surrounding logic. 2) it hasn't been reported on the 6 o'clock news. 3) too many ways and places to list. I'd start by reexamining the problem. Rsync is for syncronizing directory trees and incendentally files. Only syncronizing part of a file is a very unusual requirement. In most cases when a very unusual requirement appears (like this one) it is because the available options haven't been explored. This sounds like a config file, most config file formats support something like an #include directive so you can seperate local from global. The same holds true for scripting languages. More than one person has suggested doing cut; rsync; cat If it does come to that it might be better to only cut once. Keep it as two seperate files and cat them together into a third after each rsync. But first explore the possibility of having whatever uses the file read from to files instead of the one; that would be less fragile. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt