On Tue, Dec 16, 2008 at 07:34:10PM +1100, Patrick Lesslie wrote:
> On Sun, Dec 14, 2008 at 11:38:10PM +1100, R.G.Salisbury wrote:
> > Like the deal with the trailing slash ..... which can cause issues ---
> > (often put there by bashs tab completion).
> > I like putting a "*" after a trailing slash as i find it more intuitive.
> 
> The trailing slash or not option is handy once you know about it, but
> confusing until you do.
> 
> It also makes a difference whether you put a "*" after the trailing slash
> or not, since the shell interpolates the "*" and doesn't include hidden
> files, which may be important for a home directory backup for example.

Here's an idiom which has saved me thinking too hard; use . as the source:

    cd /whatever/source/ && rsync -a . /some/destination/directory

It will work the same whether source is just source or source/
It will fail nicely if /some/destination/directory doesn't exist
It will work the same with the same sort of errors if you use cp -a
instead of rsync -a.
It picks up .files in source as well which rsync source/* /some/dest/ doesn't.


Matt

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to