Re: disable interpretation of trailing slash

2012-01-09 Thread John J Foerch
"Voelker, Bernhard"  writes:
> John J Foerch wrote:
>
>> So I may take up your suggestion for my own use, but I did want to put
>> forward the idea that since in my experience, trailing slash
>> interpretation is an often-mentioned stumbling-block for rsync users,
>> maybe it would be appropriate for rsync itself to provide a convenient
>> alternative.
>
> I've also been using rsync for many years, and from right at the
> beginning, I started using the "dir/." syntax to not fall into that
> trap. It always works and is also nice to use in scripts as an
> accidental "dir/./." does not harm ;-)
>
> Have a nice day,
> Berny

Is a trailing "/." exactly equivalent to a trailing "/" in all ways?  If
so, then if the command-line option I asked for were introduced, when
used, there would still be a way to specify "contents of" a source by
means of "/." instead of "/".  That would be a bonus.

Cheers.

-- 
John Foerch

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


RE: disable interpretation of trailing slash

2012-01-09 Thread Voelker, Bernhard
John J Foerch wrote:

> So I may take up your suggestion for my own use, but I did want to put
> forward the idea that since in my experience, trailing slash
> interpretation is an often-mentioned stumbling-block for rsync users,
> maybe it would be appropriate for rsync itself to provide a convenient
> alternative.

I've also been using rsync for many years, and from right at the
beginning, I started using the "dir/." syntax to not fall into that
trap. It always works and is also nice to use in scripts as an
accidental "dir/./." does not harm ;-)

Have a nice day,
Berny
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: disable interpretation of trailing slash

2012-01-08 Thread John J Foerch
Wayne Davison  writes:
> One solution is to install a bash script (or setup a bash function) in place 
> of
> the real rsync that strips a single trailing slash from each arg.  That lets
> you specify dir// if you want to copy a dir's contents.  Here's one I did some
> mild tesing on and it appears to work OK:
>

Wayne Davison  writes:
> On Sat, Jan 7, 2012 at 11:19 PM, Wayne Davison  wrote:
>
> Here's one I did some mild tesing on and it appears to work OK:
>
>
> I just realized that script would turn the arg "/" into an empty string.
>  You'll want to fix that if you use the idea.  Also, if you want the idiom to
> be optional, you could either (1) have the bash script look for an opt and
> decide if it should do the stripping, or (2) name the script something like
> "rs" or "rsyncs" (or whatever) and use the slash-strip version only when
> desired.

This is definitely a workable idea, and I may use some variant of it,
but here are some thoughts:

 - I wouldn't use the name "rsync" for the wrapper script, because that
   is just setting oneself up for accidents, analogous to the common
   example of why it is a bad idea to 'alias rm="rm -i"': safety-nets
   are fine until you're in a context without them, and you forget that
   they aren't there.

 - Stripping a slash from every argument is not quite the whole story,
   because options which take arguments could have significant trailing
   slashes.

So I may take up your suggestion for my own use, but I did want to put
forward the idea that since in my experience, trailing slash
interpretation is an often-mentioned stumbling-block for rsync users,
maybe it would be appropriate for rsync itself to provide a convenient
alternative.

Thank you for your time.

-- 
John Foerch

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: disable interpretation of trailing slash

2012-01-07 Thread Wayne Davison
On Sat, Jan 7, 2012 at 11:19 PM, Wayne Davison  wrote:

> Here's one I did some mild tesing on and it appears to work OK:
>

I just realized that script would turn the arg "/" into an empty string.
 You'll want to fix that if you use the idea.  Also, if you want the idiom
to be optional, you could either (1) have the bash script look for an opt
and decide if it should do the stripping, or (2) name the script something
like "rs" or "rsyncs" (or whatever) and use the slash-strip version only
when desired.

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: disable interpretation of trailing slash

2012-01-07 Thread Wayne Davison
On Sat, Jan 7, 2012 at 6:40 PM, John J Foerch wrote:

> This is a feature request for a command-line option to disable
> special interpretation of trailing slashes on source directories.


One solution is to install a bash script (or setup a bash function) in
place of the real rsync that strips a single trailing slash from each arg.
 That lets you specify dir// if you want to copy a dir's contents.  Here's
one I did some mild tesing on and it appears to work OK:

#!/bin/bash
args=()
for arg in "${@}"; do
# Strip a single trailing slash from each arg (if present)
args=("${args[@]}" "${arg%/}")
done
echo /usr/bin/rsync "${args[@]}"
#exec /usr/bin/rsync "${args[@]}"

When you're satisfied with that, comment out the echo and uncomment the
exec.  Install it somewhere on your path ahead of the real rsync, or rename
the real rsync (tweak the script to exec the right binary) and install the
script in place of the current rsync binary.

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: disable interpretation of trailing slash

2012-01-07 Thread John J Foerch
My request is not to change the default behavior, but to add a new
command-line option that would effect new behavior.  When one wants the
default behavior, one simply does not use the option.

Kevin Korb  writes:
> I don't speak for anyone else but I would be opposed to this.
> Primarily because there isn't an alternate syntax that performs the
> exact same function /path/* doesn't work as expected if using --delete
> (and for good reason).
>
> On 01/07/12 21:40, John J Foerch wrote:
>> Hello,
>> 
>> This is a feature request for a command-line option to disable
>> special interpretation of trailing slashes on source directories.
>> I have been using rsync for a couple of years now (what an awesome
>> program!) and the meaning of the trailing slash on a source is
>> always the one aspect of its syntax that slows me down and makes me
>> check and re-check the manual to ensure that I have remembered its
>> behavior correctly.  The likelihood of making a mistake with a
>> trailing slash is compounded by the fact that shell completion
>> (e.g. in bash) puts it there by default, and it was this very
>> behavior that caused me to be a little too carefree last week and
>> mess up a large backup.  While the trailing slash is a powerful
>> and useful feature, it also strikes me as risky to have so much
>> power built into a single character of syntax, especially a
>> character which usually has no special meaning in other programs.
>> Others I have chatted with on this topic shared the same view.  My
>> feature request then, is for a command line switch to disable the
>> special interpretation of the trailing slash on sources.  A short
>> option would be preferred.  My reasoning is that it is easier to
>> remember to always use a particular option, except in situations
>> requiring more nuance, than it is to remember the special rule and
>> to always check the syntax of the sources.
>> 
>> Thank you for your time.
>> 
>
> -- 
> ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
>   Kevin Korb  Phone:(407) 252-6853
>   Systems Administrator   Internet:
>   FutureQuest, Inc.   ke...@futurequest.net  (work)
>   Orlando, Floridak...@sanitarium.net (personal)
>   Web page:   http://www.sanitarium.net/
>   PGP public key available on web site.
> ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


RE: disable interpretation of trailing slash

2012-01-07 Thread Tony Abernethy
If the directories are large enough, /path/* becomes too long.
My own opinion is that that syntax is a very small price to 
pay for the flexibility and power.

> -Original Message-
> From: rsync-boun...@lists.samba.org [mailto:rsync-
> boun...@lists.samba.org] On Behalf Of Kevin Korb
> Sent: Saturday, January 07, 2012 8:48 PM
> To: rsync@lists.samba.org
> Subject: Re: disable interpretation of trailing slash
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> I don't speak for anyone else but I would be opposed to this.
> Primarily because there isn't an alternate syntax that performs the
> exact same function /path/* doesn't work as expected if using --delete
> (and for good reason).
> 
> On 01/07/12 21:40, John J Foerch wrote:
> > Hello,
> >
> > This is a feature request for a command-line option to disable
> > special interpretation of trailing slashes on source directories.
> > I have been using rsync for a couple of years now (what an awesome
> > program!) and the meaning of the trailing slash on a source is
> > always the one aspect of its syntax that slows me down and makes me
> > check and re-check the manual to ensure that I have remembered its
> > behavior correctly.  The likelihood of making a mistake with a
> > trailing slash is compounded by the fact that shell completion
> > (e.g. in bash) puts it there by default, and it was this very
> > behavior that caused me to be a little too carefree last week and
> > mess up a large backup.  While the trailing slash is a powerful
> > and useful feature, it also strikes me as risky to have so much
> > power built into a single character of syntax, especially a
> > character which usually has no special meaning in other programs.
> > Others I have chatted with on this topic shared the same view.  My
> > feature request then, is for a command line switch to disable the
> > special interpretation of the trailing slash on sources.  A short
> > option would be preferred.  My reasoning is that it is easier to
> > remember to always use a particular option, except in situations
> > requiring more nuance, than it is to remember the special rule and
> > to always check the syntax of the sources.
> >
> > Thank you for your time.
> >
> 
> - --
> ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-
> ,._.,-*~
>   Kevin Korb  Phone:(407) 252-6853
>   Systems Administrator   Internet:
>   FutureQuest, Inc.   ke...@futurequest.net  (work)
>   Orlando, Floridak...@sanitarium.net (personal)
>   Web page:   http://www.sanitarium.net/
>   PGP public key available on web site.
> ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-
> ,._.,-*~
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2.0.17 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk8JA90ACgkQVKC1jlbQAQcecwCcCCIUg19hL/gxyDKJh2OTBBO4
> N5QAnA95PRm1pDwn2MPeCmy7o2zldc+I
> =osqT
> -END PGP SIGNATURE-
> --
> Please use reply-all for most replies to avoid omitting the mailing
> list.
> To unsubscribe or change options:
> https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-
> questions.html
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: disable interpretation of trailing slash

2012-01-07 Thread Kevin Korb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I don't speak for anyone else but I would be opposed to this.
Primarily because there isn't an alternate syntax that performs the
exact same function /path/* doesn't work as expected if using --delete
(and for good reason).

On 01/07/12 21:40, John J Foerch wrote:
> Hello,
> 
> This is a feature request for a command-line option to disable
> special interpretation of trailing slashes on source directories.
> I have been using rsync for a couple of years now (what an awesome
> program!) and the meaning of the trailing slash on a source is
> always the one aspect of its syntax that slows me down and makes me
> check and re-check the manual to ensure that I have remembered its
> behavior correctly.  The likelihood of making a mistake with a
> trailing slash is compounded by the fact that shell completion
> (e.g. in bash) puts it there by default, and it was this very
> behavior that caused me to be a little too carefree last week and
> mess up a large backup.  While the trailing slash is a powerful
> and useful feature, it also strikes me as risky to have so much
> power built into a single character of syntax, especially a
> character which usually has no special meaning in other programs.
> Others I have chatted with on this topic shared the same view.  My
> feature request then, is for a command line switch to disable the
> special interpretation of the trailing slash on sources.  A short
> option would be preferred.  My reasoning is that it is easier to
> remember to always use a particular option, except in situations
> requiring more nuance, than it is to remember the special rule and
> to always check the syntax of the sources.
> 
> Thank you for your time.
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8JA90ACgkQVKC1jlbQAQcecwCcCCIUg19hL/gxyDKJh2OTBBO4
N5QAnA95PRm1pDwn2MPeCmy7o2zldc+I
=osqT
-END PGP SIGNATURE-
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


disable interpretation of trailing slash

2012-01-07 Thread John J Foerch
Hello,

This is a feature request for a command-line option to disable special
interpretation of trailing slashes on source directories.  I have been
using rsync for a couple of years now (what an awesome program!) and the
meaning of the trailing slash on a source is always the one aspect of
its syntax that slows me down and makes me check and re-check the manual
to ensure that I have remembered its behavior correctly.  The likelihood
of making a mistake with a trailing slash is compounded by the fact that
shell completion (e.g. in bash) puts it there by default, and it was
this very behavior that caused me to be a little too carefree last week
and mess up a large backup.  While the trailing slash is a powerful and
useful feature, it also strikes me as risky to have so much power built
into a single character of syntax, especially a character which usually
has no special meaning in other programs.  Others I have chatted with on
this topic shared the same view.  My feature request then, is for a
command line switch to disable the special interpretation of the
trailing slash on sources.  A short option would be preferred.  My
reasoning is that it is easier to remember to always use a particular
option, except in situations requiring more nuance, than it is to
remember the special rule and to always check the syntax of the sources.

Thank you for your time.

-- 
John Foerch

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html