Hongyi Zhao
2015-Apr-10 23:11 UTC
Finding specific files/directories from a remote rsync server.
Hi all, Suppose I have remote rsync server, named as: rsync.example.net. And I want to finding some specific files/directories from it. To do this, I must let my local rsync client to do a traversing among all of its modules and the corresponding sub-directories. Say, if I want to find all of the `foo/file' on this rsync server, i.e., a file named file which is located under the foo directory. How can I do this thing within bash/shell script with the invoking on rsync client? Regards -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
Wayne Davison
2015-Apr-12 16:44 UTC
Finding specific files/directories from a remote rsync server.
On Fri, Apr 10, 2015 at 4:11 PM, Hongyi Zhao <hongyi.zhao at gmail.com> wrote:> Say, if I want to find all of the `foo/file' on this rsync server >You'd use filter (include/exclude) rules. See in the man page about its notes on how rsync requires you to include all directories in order to traverse the tree and you'd end up with something like this: rsync -aiv --include=foo/file --include='*/' --exclude='*' rsync.example.net::module/ /dest/ You might also try using --prune-empty-dirs. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20150412/df2c7cfa/attachment.html>
Hongyi Zhao
2015-Apr-13 11:33 UTC
Finding specific files/directories from a remote rsync server.
On Sun, 12 Apr 2015 09:44:56 -0700, Wayne Davison wrote:> You'd use filter (include/exclude) rules. See in the man page about its > notes on how rsync requires you to include all directories in order to > traverse the tree and you'd end up with something like this: > > rsync -aiv --include=foo/file --include='*/' --exclude='*' > rsync.example.net::module/ /dest/ > > You might also try using --prune-empty-dirs. > > ..wayne..Thanks a lot for your hints. Regards -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
Hongyi Zhao
2015-Apr-13 11:42 UTC
Finding specific files/directories from a remote rsync server.
On Sun, 12 Apr 2015 09:44:56 -0700, Wayne Davison wrote:> rsync -aiv --include=foo/file --include='*/' --exclude='*' > rsync.example.net::module/ /dest/Another issue is as follows: if I have known that the `foo/file' is located under some sub-directories under a folder named `bar' in in the module's directory, in this case, I want to save the time for only searching into all of the sub-directories of rsync.example.net::module/ bar/. Then what's revision should be done on the --include='*/' to adapt for this case? Regards> > You might also try using --prune-empty-dirs.-- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.
Maybe Matching Threads
- Finding specific files/directories from a remote rsync server.
- Downloading specific files with rsync and make them keeping the original directories structures.
- Is it possiable to suppress the site-specified messages?
- Can I let rsync only transer a part of file within specific byte ranges?
- How to capture the stderr of rsync and redirect it into a file?