Timeline for How to include files that are excluded in an rsync
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 3, 2021 at 7:36 | comment | added | haridsv | You are right! This works: rsync -avP --exclude=/dir/.htaccess src/dir dst | |
| Mar 2, 2021 at 14:22 | comment | added | Gilles 'SO- stop being evil' | @haridsv In the first case, the root is src/dir and you're copying the root, so src/dir/.htaccess is excluded. In the second case, the root is src and you're copying dir, so src/.htaccess is excluded. | |
| Mar 2, 2021 at 13:53 | comment | added | haridsv | Any idea why rsync -avP --exclude=/.htaccess src/dir/ dst/dir/ works as expected (excludes .htaccess only at the root directory), but rsync -avP --exclude=/.htaccess src/dir dst doesn't (it fails to exclude even at the root)? | |
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot | replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/ | |
| Nov 19, 2012 at 14:47 | comment | added | Tobias Kienzler | @Rich note that if there are hidden directories that contain a .htaccess file, you'll have to --include='.*/' (I think) before the final --exclude, see also here | |
| Apr 11, 2011 at 18:26 | comment | added | Rich | Thanks, I had tried putting the --include first, but the "./" in front of the "./.htaccess" was what was killing it. | |
| Apr 11, 2011 at 18:25 | vote | accept | Rich | ||
| Apr 11, 2011 at 12:22 | comment | added | Gilles 'SO- stop being evil' | @fred.bear: That one was a genuine typo, and a nasty one. Thanks for spotting it! | |
| Apr 10, 2011 at 23:19 | history | answered | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |