What's the difference b/w these 2 commands?
/usr/local/bin/rsync -avz --delete /rebel-sdc/assp420 /rebel-sdc01/ and /usr/local/bin/rsync -avz --delete /rebel-sdc/assp420/ /rebel-sdc01/ Obviously the easy answer is the "/" at the end of the source tree, but what is the difference to rsync? The reason I ask is that I used the second version and proceeded to removed everything in the target directory. There are other assp* directories under the source and target trees that I want to make identical (assp410, assp430, etc.). So under /rebel-sdc01 there are several directory structures. Using the second version of the command it removed everything under /rebel-sdc01 and put all the data under assp420 there; I wanted it to just put assp420 under it. Thanks. -- = Jeff Kennedy Unix Administrator AMCC [EMAIL PROTECTED]
Re: Option --execute=/path/to/script.sh
On Wed, Feb 07, 2001 at 04:43:02AM +0800, Wrieth, Henry wrote: Greetings, I primarily use rsync to update remote hosts when source files are edited. This means from one host, I upload to many rsync daemons listening on those remote hosts. This is much easier for me than running a daemon on the source and executing pulls on all the remote hosts. My problem is that I often want to execute post-distribution scripts on the endpoints (daemons) such as 'bounce_the_server'. This is similar to Interwoven's OpenDeploy feature "deploy_and_run". It seems trivial to do this when running rsync over rsh or ssh since we already have .rhosts trust to run rsync itself and thus can run other rsh commands. But when running in client-server mode there would need to be a '--execute=/path/to/script.sh' Option to do this. Has anybody thought about or working on this type of functionality? Yes, it has been thought about, and I think it is a good idea, but nobody has done anything about it. I found an archive of a discussion from two years ago in the rsync bugs tracker. See http://rsync.samba.org/cgi-bin/rsync/todo?id=1592;user=guest;selectid=1592 - Dave Dykstra
What's the difference b/w these 2 commands?
Date: Tue, 6 Feb 2001 14:26:19 -0600 From: Dave Dykstra [EMAIL PROTECTED] From the man page: a trailing slash on the source changes this behavior to transfer all files from the directory src/bar on the machine foo into the /data/tmp/. A trailing / on a source name means "copy the contents of this directory". Without a trailing slash it means "copy the directory". This dif- ference becomes particularly important when using the --delete option. I can't help but think that perhaps we need to change the UI by, for example, adding a switch called --copy-directory-contents, instead of depending on whether or not there's a trailing slash there. I see no other common Unix applications where a trailing slash makes any difference to the semantics, and things like tcsh will often append them when using completion whereas other tools may not. It also means that any tool which generates pathnames for rsync command-line options must have extra complexity to guarantee that the trailing slash either does or does not appear, depending on what's wanted---whereas having a normal switch would be trivial to implement, simplify the caller, and make it far clearer to a human reading the result what is intended. It's just too obscure. People keep getting screwed by it. Obviously, this is an incompatible change to the existing semantics, and will break scripts. I don't know of a clean way to deal with that. (Have a --traditional switch as well? A --nontraditional one? [eww...]) Perhaps a good time to do this is if a --files-from= is ever added, as part of a more general project to allow bypassing most of the weird specialized language (via command options, trailing slashes, and so forth) that tells rsync which files to process, in favor of letting the user employ existing tools, with which she might be more familiar, to pick the set. I really feel that rsync tries to do too much here.
Re: What's the difference b/w these 2 commands?
A trailing / on a source directory name means "copy the contents of this directory". Without a trailing slash it means "copy the directory". I can't help but think that perhaps we need to change the UI by, for example, adding a switch called --copy-directory-contents, instead of depending on whether or not there's a trailing slash there. Hear Hear. The existing behaviour is a useful shorthand when using rsync from the command line, but scripts must have clumsy logic to ensure they do or don't have the slash. Otherwise unexpected behaviour is passed on to the script user. I'd suggest a pair of mutually exclusive flags that override the slash. Perhaps: -k --copy-directory-contents and -K --copy-directory Mnemonic: -k kontents -K (perl regex like) NOT k Or:--copy-directory=directory and --copy-directory=contents This doesn't break anything and makes scripting rsync easier and clearer. michaelj
Re: Option --execute=/path/to/script.sh
I do this on a regular (nightly!) basis - my script does the rsync and then just runs an ssh to run the remote script. Not quite the same thing as having the rsync daemon do it, but quite powerful. On Wed, 7 Feb 2001, Wrieth, Henry wrote: Greetings, I primarily use rsync to update remote hosts when source files are edited. This means from one host, I upload to many rsync daemons listening on those remote hosts. This is much easier for me than running a daemon on the source and executing pulls on all the remote hosts. My problem is that I often want to execute post-distribution scripts on the endpoints (daemons) such as 'bounce_the_server'. This is similar to Interwoven's OpenDeploy feature "deploy_and_run". It seems trivial to do this when running rsync over rsh or ssh since we already have .rhosts trust to run rsync itself and thus can run other rsh commands. But when running in client-server mode there would need to be a '--execute=/path/to/script.sh' Option to do this. Has anybody thought about or working on this type of functionality? Regards, Henry Wrieth CREDIT | FIRST SUISSE | BOSTON Global Internet Intranet Services / Global Web Services (New York) Voice: 212.325.7714 Fax: 212.325.9596 E-mail: [EMAIL PROTECTED] Page: 888.977.8523 or [EMAIL PROTECTED] Wrieth, Henry.vcf This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. CREDIT SUISSE GROUP and each of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of any such entity. Unless otherwise stated, any pricing information given in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation. -- Robert Scholten Tel: +61 3 8344 5457 Mob: 0412 834 196 School of Physics Fax: +61 3 9347 4783 University of Melbourne email: [EMAIL PROTECTED] Victoria 3010 AUSTRALIA http://www.ph.unimelb.edu.au/~scholten