[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rsync
Subject:    Re: Syncing multiple sub-directories to one directory
From:       Wayne Davison via rsync <rsync () lists ! samba ! org>
Date:       2020-09-30 16:53:39
Message-ID: CAHSx_Svj0CzFQ7ZQe7vo2e=6qy=8GSW3K7rtfCgMf417kuyZNw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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..

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr">On Tue, Sep 29, 2020 at 4:46 PM Rob Campbell \
wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks  for your help.   What \
you provided didn&#39;t work for me because that still placed things in \
subdirectories.</div></div></blockquote><div><br></div><div>Ah, that&#39;s what you \
were trying to do. Your original email sounded like you just didn&#39;t want it to \
recurse into subdirectories.</div><div><br></div><div>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:</div><div></div><div><br></div><div><div class="gmail_quote">rsync -riv \
--progress --include &#39;*.jp*g&#39; --include &#39;*.png&#39; --include \
&#39;*.dng&#39; --include &#39;*.raw&#39; --include &#39;*.nef&#39;  --exclude \
&#39;*&#39; /my/phone/root/dir/{Duo,DCIM,WhatsApp}/ \
/my/backup/directory/for/images/</div></div><div class="gmail_quote"><br \
clear="all"><div><div dir="ltr" \
class="gmail_signature">..wayne..</div></div></div></div></div>



-- 
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic