Bug 11544 - doesn't copy files starting with "." in the current directory
Summary: doesn't copy files starting with "." in the current directory
Status: RESOLVED INVALID
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.1
Hardware: All Linux
: P5 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-06 21:40 UTC by teo8976
Modified: 2015-10-07 04:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description teo8976 2015-10-06 21:40:06 UTC
rsync -avzL --no-o --no-g ./*  user@example.org:~/path/to/folder

Expected: 
Either it should copy transfer all files in the current directory and subdirectories recursively, including hidden files (i.e. whose name starts with a dot) or it may omit by default all hidden files, from both the current directory and the subdirectories, and you could use an --include rule to explicitly include hidden files (or there may exist a dedicated option).


Observed: hidden files (whose name starts with a dot) in the current directory are not sent. However, hidden files in all the subdirectory *are* transferred.

That's inconsistent and doesn't make any sense.
Comment 1 Kevin Korb 2015-10-06 21:42:51 UTC
Drop the * in your source parameter.
Comment 2 teo8976 2015-10-06 22:20:59 UTC
And could you explain how that is the expected behavior?
Comment 3 Kevin Korb 2015-10-06 22:51:40 UTC
Simple...
source == copy the source directory
source/ == copy the contents of the directory
source/* == copy everything that your shell globs that wildcard into.

IOW, ./* won't copy anything that "echo ./*" doesn't list.  Having a * in there also short-circuits --delete.
Comment 4 Wayne Davison 2015-10-07 04:16:36 UTC
As noted, this is because your shell expands the wildcard.