Re: Syncing multiple sub-directories to one directory

2020-09-29 Thread Kevin Korb via rsync
Interesting idea.  It isn't something I have ever wanted to do.  BTW, if
your find is recent use + instead of \;.  + replaces {} with however
many entries fit in the command line length limit instead of running
individual rsync processes for each entry.

On 9/29/20 7:46 PM, Rob Campbell via rsync wrote:
> Thanks for your help.  What you provided didn't work for me because that
> still placed things in subdirectories.
> 
> I figured it out.  This puts it all in the images directory.
> 
> find /my/phone/root/dir/ \( -path '*Duo*' -o -path '*DCIM*' -o -path
> '*Pictures*' -o -path '*Camera*' -o -path "*Download*" -o -path
> "*textgram*" -o -path "*WhatsApp*" ! -path '*.textgram*' ! -path
> '*.thumbnails*' \) -type f \( -iname '*.jp*g' -o -iname '*.png' -o
> -iname '*.dng' -o -iname '*.raw' -o -iname '*.raw' \) -exec rsync -uz
> --progress "{}" /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!
> 
> 
> On Tue, Sep 29, 2020 at 1:33 PM Wayne Davison  > wrote:
> 
> On Tue, Sep 29, 2020 at 7:38 AM Rob Campbell wrote:
> 
> 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/
> 
> 
> You didn't specify what isn't working as you expect. That command
> works fine for the 3 listed dir names as long as you either don't
> have matching files inside /my/phone/root/dir (or as long as it's ok
> to also copy those files) and as long as there aren't subdirs or
> files named the same as the 3 top dirs you included. The latter can
> be fixed by anchoring your dir names and making them only match a
> dir (e.g. --include '/Duo/').  If you want to have the copy avoid
> files in the top dir you can either change all the file-based
> includes to have a "*/" prefix (such as "--include '*/*.png' ...")
> or you can change the dir includes into args and exclude '*/*'
> instead of "*".  The last option would look like this (I also tossed
> in -i):
> 
> 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/
> 
> That assumes you've got bash to do the brace expansion, but you
> could change that into 3 arg paths if you need to. You may also want
> to add --del if you want rsync to delete inside the 3 listed dirs.
> 
> I'm not sure why you listed an extra command with "NewDir" when it's
> not mentioned in the first command.  If that is an indication that
> you really want to copy all dirs under root/dir (not just the 3
> named dirs in the first command) then you could use an include of
> "/*/" to match any dir in the root of the transfer, like this:
> 
> rsync -riv --progress --include '*.jp*g' --include '*.png' --include
> '*.dng' --include '*.raw' --include '*.nef' --include '/*/'
> --exclude '*' /my/phone/root/dir/ /my/backup/directory/for/images/
> 
> One last suggestion, I like to make the args shorter by using -f
> (filter) commands, so an include example is -f '+ *.png' and an
> exclude example is -f '- /*/' (those are identical to the equivalent
> include/exclude args, so that's just personal preference).
> 
> ..wayne..
> 
> 

-- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   https://sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,



signature.asc
Description: OpenPGP digital signature
-- 
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: Syncing multiple sub-directories to one directory

2020-09-29 Thread Rob Campbell via rsync
Thanks for your help.  What you provided didn't work for me because that
still placed things in subdirectories.

I figured it out.  This puts it all in the images directory.

find /my/phone/root/dir/ \( -path '*Duo*' -o -path '*DCIM*' -o -path
'*Pictures*' -o -path '*Camera*' -o -path "*Download*" -o -path
"*textgram*" -o -path "*WhatsApp*" ! -path '*.textgram*' ! -path
'*.thumbnails*' \) -type f \( -iname '*.jp*g' -o -iname '*.png' -o -iname
'*.dng' -o -iname '*.raw' -o -iname '*.raw' \) -exec rsync -uz --progress
"{}" /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!


On Tue, Sep 29, 2020 at 1:33 PM Wayne Davison  wrote:

> On Tue, Sep 29, 2020 at 7:38 AM Rob Campbell wrote:
>
>> 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/
>>
>
> You didn't specify what isn't working as you expect. That command works
> fine for the 3 listed dir names as long as you either don't have matching
> files inside /my/phone/root/dir (or as long as it's ok to also copy those
> files) and as long as there aren't subdirs or files named the same as the 3
> top dirs you included. The latter can be fixed by anchoring your dir names
> and making them only match a dir (e.g. --include '/Duo/').  If you want to
> have the copy avoid files in the top dir you can either change all the
> file-based includes to have a "*/" prefix (such as "--include '*/*.png'
> ...") or you can change the dir includes into args and exclude '*/*'
> instead of "*".  The last option would look like this (I also tossed in -i):
>
> 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/
>
> That assumes you've got bash to do the brace expansion, but you could
> change that into 3 arg paths if you need to. You may also want to add --del
> if you want rsync to delete inside the 3 listed dirs.
>
> I'm not sure why you listed an extra command with "NewDir" when it's not
> mentioned in the first command.  If that is an indication that you really
> want to copy all dirs under root/dir (not just the 3 named dirs in the
> first command) then you could use an include of "/*/" to match any dir in
> the root of the transfer, like this:
>
> rsync -riv --progress --include '*.jp*g' --include '*.png' --include
> '*.dng' --include '*.raw' --include '*.nef' --include '/*/' --exclude '*'
> /my/phone/root/dir/ /my/backup/directory/for/images/
>
> One last suggestion, I like to make the args shorter by using -f (filter)
> commands, so an include example is -f '+ *.png' and an exclude example is
> -f '- /*/' (those are identical to the equivalent include/exclude args, so
> that's just personal preference).
>
> ..wayne..
>
-- 
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: strange crash with md5p8.diff + xxhash

2020-09-29 Thread Wayne Davison via rsync
On Sun, Sep 27, 2020 at 9:01 AM Madhu via rsync 
wrote:

> Turns out the comment in rsync.h: (struct name_num_obj):
> struct name_num_item list[8]; /* A big-enough len (we'll get a
> compile error if it is ever too small) */
>
> isn't correct. I don't get a compile error.


Gcc likes to generate just a warning, not an error, which is enough for me
to notice the issue and fix it.  However, it would be nice if it was an
actual error, so I'm tweaking configure.ac to specify -pedantic-errors
(sometimes followed by --Wno-pedantic) for gcc, which seems to turn it into
an error just fine.  I've also expanded the array a bit.

..wayne..
-- 
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: rsync 3.1.3 dry run bug?

2020-09-29 Thread Wayne Davison via rsync
On Sun, Sep 27, 2020 at 12:27 PM Dipl.-Ing. Wolf-Dieter Pichler wrote:

> In this example output rsync says that it would just perform two
> group changes, BUT despite the -n option it actually synced some documents.
>

I doubt that very much, so I'd suggest checking on what else might be going
on.  Rsync has a bunch of safety functions with built-in dry-run checks
that keep it from making the changes that it itemizes that need to be
done.  And if it didn't even mention that a file needs to be updated,
there's no reason for it to have somehow made a secret change.  If you were
expecting to see a file change in the list of dry-run changes and it's not
there, then something prior to the rsync dry-run must have changed it.
Given that you're using -H, you might check if the affected file was linked
to a file that was recently changed in some other copy.

..wayne..
-- 
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: Syncing multiple sub-directories to one directory

2020-09-29 Thread Wayne Davison via rsync
On Tue, Sep 29, 2020 at 7:38 AM Rob Campbell wrote:

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

You didn't specify what isn't working as you expect. That command works
fine for the 3 listed dir names as long as you either don't have matching
files inside /my/phone/root/dir (or as long as it's ok to also copy those
files) and as long as there aren't subdirs or files named the same as the 3
top dirs you included. The latter can be fixed by anchoring your dir names
and making them only match a dir (e.g. --include '/Duo/').  If you want to
have the copy avoid files in the top dir you can either change all the
file-based includes to have a "*/" prefix (such as "--include '*/*.png'
...") or you can change the dir includes into args and exclude '*/*'
instead of "*".  The last option would look like this (I also tossed in -i):

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/

That assumes you've got bash to do the brace expansion, but you could
change that into 3 arg paths if you need to. You may also want to add --del
if you want rsync to delete inside the 3 listed dirs.

I'm not sure why you listed an extra command with "NewDir" when it's not
mentioned in the first command.  If that is an indication that you really
want to copy all dirs under root/dir (not just the 3 named dirs in the
first command) then you could use an include of "/*/" to match any dir in
the root of the transfer, like this:

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

One last suggestion, I like to make the args shorter by using -f (filter)
commands, so an include example is -f '+ *.png' and an exclude example is
-f '- /*/' (those are identical to the equivalent include/exclude args, so
that's just personal preference).

..wayne..
-- 
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: Back-up differences. Raspberry Pi and Fedora

2020-09-29 Thread Kevin Korb via rsync
On 9/29/20 7:07 AM, joe--- via rsync wrote:
> unknown module Linux1
This would imply that "Linux1" is not defined in the rsyncd.conf file on
the backup server.  Of course since it is a NAS appliance I don't know
if you have any access to the config file.

1 check you could run is 'rsync root@server::'.  This would list the
modules the server is configured with (assuming listing is allowed).


-- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   https://sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,



signature.asc
Description: OpenPGP digital signature
-- 
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


Back-up differences. Raspberry Pi and Fedora

2020-09-29 Thread joe--- via rsync
I am using the 'backup to a central backup server with 7 day 
incremental' example to archive three separate computers to identically 
configured (apart from name) shares on a Western Digital 'MyBookLive' 
NAS which has rsync enabled. The backup from two Raspberry Pi Computers 
operates without a problem but the backup from a Fedora 32 computer 
fails with an 'unknown module Linux1' error message. The only difference 
between the code in the .sh module for all three computers is the name 
of the share(Linux1 for the Fedora Computer) and the home directory.


#~ #!/bin/sh

# This script does personal backups to a rsync backup server. You will 
end up

# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# tri...@linuxcare.com

HOME=/home/XXX

# directory to backup
BDIR=/

# excludes file - this contains a wildcard pattern per line of files to 
exclude

EXCLUDES=$HOME/Documents/exclude.txt

# the name of the backup machine
BSERVER=r...@nnn.nnn.nnn.nnn

export RSYNC_PASSWORD=



BACKUPDIR=`date +%A`

OPTS="--force --ignore-errors --delete-excluded 
--exclude-from=/home/joe/Documents/exclude.txt

  --delete --backup --backup-dir=/$BACKUPDIR -a"

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin

# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
rsync --delete -a $HOME/emptydir/ $BSERVER::Linux1/$BACKUPDIR/
rmdir $HOME/emptydir

# now the actual transfer
rsync $OPTS $BDIR $BSERVER::Linux1/current


Can anyone explain why this is happening please?

Joe Curtis



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


Syncing multiple sub-directories to one directory

2020-09-29 Thread Rob Campbell via rsync
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!
-- 
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