Syncing multiple sub-directories to one directory

Rob Campbell robcampbell08105 at gmail.com
Tue Sep 29 14:37:26 UTC 2020


I would like to sync many subdirectories into one directory with no
subdirectories. I've tried

rsync -rv --progress --include '*.jp*g' --include '*.png' --include '*.dng'
--include '*.raw' --include '*.nef' --include 'Duo' --include 'DCIM'
--include 'WhatsApp' --exclude '*' /my/phone/root/dir/
/my/backup/directory/for/images/

I'd like to do this w/o separate rsync commands such as
rsync -rv --progress --include '*.jp*g' --include '*.png' --include '*.dng'
--include '*.raw' --include '*.nef' --exclude '*' /my/phone/root/dir/DCIM
/my/backup/directory/for/images/

rsync -rv --progress --include '*.jp*g' --include '*.png' --include '*.dng'
--include '*.raw' --include '*.nef' --exclude '*' /my/phone/root/dir/Duo
/my/backup/directory/for/images/

rsync -rv --progress --include '*.jp*g' --include '*.png' --include '*.dng'
--include '*.raw' --include '*.nef' --exclude '*'
/my/phone/root/dir/WhatsApp /my/backup/directory/for/images/
  -- This has subdirectories

rsync -rv --progress --include '*.jp*g' --include '*.png' --include '*.dng'
--include '*.raw' --include '*.nef' --exclude '*' /my/phone/root/dir/NewDir
/my/backup/directory/for/images/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you are principled, set standards and stick to them some people will
fall out of your life; let them!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20200929/ebd4d4b5/attachment.htm>


More information about the rsync mailing list