Re: print only first level directory name when copying files
Fourhundred Thecat via rsync <400the...@lists.samba.org> wrote: > I am copying /mnt/foo to /mnt/bar/ > >rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ > > /mnt/foo contains deep directory structure, ie: > >/mnt/foo/aaa/ >/mnt/foo/aaa/somestuff/ >/mnt/foo/aaa/somestuff/file1 > >/mnt/foo/bbb/ >/mnt/foo/bbb/someotherstuff/ >/mnt/foo/bbb/someotherstuff/file2 > > I am not interested in details which individual files were copied, just > the main directory. Is it somehow possible for rsync to only report the > first level directory? > > ie, to have output like this when copying: > >/mnt/foo/aaa/ >/mnt/foo/bbb/ Do you need this reported in real time (e.g. to monitor progress), or just as a logfile? If the latter, filtering the output with grep might work -- something like this (untested): rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ | egrep '^/.*/.*/.*/$' -- 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
Consider POSIX_FADV_NOREUSE?
Hey rsync, Seems like there was an effort a while back to make use of POSIX_FADV_DONTNEED on linux [1]. Though the linux patches landed, apparently the rsync ones never did. Over a decade later we live in a different world. Linux is using the new-ish MGLRU on many distros, and (~6.3+) even has support for POSIX_FADV_NOREUSE [2], which was dismissed in prior discussions for lack of support. Maybe it's time to re-evaluate the utility of posix_fadvise in rsync? [1] https://lkml.org/lkml/2010/11/21/59 [2] https://lore.kernel.org/all/20221230215252.2628425-2-yuz...@google.com/T/#u Cheers, Ronan -- 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
print only first level directory name when copying files
Hello, I am copying /mnt/foo to /mnt/bar/ rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ /mnt/foo contains deep directory structure, ie: /mnt/foo/aaa/ /mnt/foo/aaa/somestuff/ /mnt/foo/aaa/somestuff/file1 /mnt/foo/bbb/ /mnt/foo/bbb/someotherstuff/ /mnt/foo/bbb/someotherstuff/file2 I am not interested in details which individual files were copied, just the main directory. Is it somehow possible for rsync to only report the first level directory? ie, to have output like this when copying: /mnt/foo/aaa/ /mnt/foo/bbb/ thanks, -- 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: print only first level directory name when copying files
Perry Hutchison via rsync wrote: > Fourhundred Thecat via rsync <400the...@lists.samba.org> wrote: > > > I am copying /mnt/foo to /mnt/bar/ > > > >rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ > > > > /mnt/foo contains deep directory structure, ie: > > > >/mnt/foo/aaa/ > >/mnt/foo/aaa/somestuff/ > >/mnt/foo/aaa/somestuff/file1 > > > >/mnt/foo/bbb/ > >/mnt/foo/bbb/someotherstuff/ > >/mnt/foo/bbb/someotherstuff/file2 > > > > I am not interested in details which individual files were copied, just > > the main directory. Is it somehow possible for rsync to only report the > > first level directory? > > > > ie, to have output like this when copying: > > > >/mnt/foo/aaa/ > >/mnt/foo/bbb/ > > Do you need this reported in real time (e.g. to monitor progress), > or just as a logfile? If the latter, filtering the output with grep > might work -- something like this (untested): > > rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ | egrep '^/.*/.*/.*/$' On second thought, that grep will match any directory name having 3 *or more* levels. This: rsync --info=name1,del2 -rl /mnt/foo /mnt/bar/ | egrep '^/[^/]*/[^/]*/[^/]*/$' should match only those with exactly 3 levels. -- 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