Syncing multiple sub-directories to one directory

Rob Campbell robcampbell08105 at gmail.com
Mon Oct 5 02:54:48 UTC 2020


After more testing, I found that that command only syncs files that are in
that top dir.  It doesn't recurse through all the dirs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you are principled, set standards and stick to them some people will
fall out of your life; let them!


On Sun, Oct 4, 2020 at 6:20 PM Rob Campbell <robcampbell08105 at gmail.com>
wrote:

> My deepest apologies.  I had an inotify running that anytime something was
> added to that directory it would run a script that was doing my original
> sync of pulling in all the directories and images.  After turning that off,
> I was able to see your line work as you said it should.  Thank you very
> much and again, I apologize for mistakenly stating the code you provided
> didn't work.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> When you are principled, set standards and stick to them some people will
> fall out of your life; let them!
>
>
> On Wed, Sep 30, 2020 at 10:46 PM Rob Campbell <robcampbell08105 at gmail.com>
> wrote:
>
>> Except some of those dir have subdir such as WhatsApp and DCIM has
>> multiple subdirs too. I would rather do it all with rsync though.
>>
>> On Wed, Sep 30, 2020, 12:54 PM Wayne Davison <wayne at opencoder.net> wrote:
>>
>>> On Tue, Sep 29, 2020 at 4:46 PM Rob Campbell wrote:
>>>
>>>> Thanks for your help.  What you provided didn't work for me because
>>>> that still placed things in subdirectories.
>>>>
>>>
>>> Ah, that's what you were trying to do. Your original email sounded like
>>> you just didn't want it to recurse into subdirectories.
>>>
>>> An easier solution than what you ended up with is to specify a trailing
>>> slash after the dir names since that tells rsync you want to copy the
>>> content of a directory rather than the directory by name:
>>>
>>> rsync -riv --progress --include '*.jp*g' --include '*.png' --include
>>> '*.dng' --include '*.raw' --include '*.nef' --exclude '*'
>>> /my/phone/root/dir/{Duo,DCIM,WhatsApp}/ /my/backup/directory/for/images/
>>>
>>> ..wayne..
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20201004/dfcc4df7/attachment.htm>


More information about the rsync mailing list