On 06/15/2018 02:14 PM, Bob Goodwin wrote:
> On 06/14/18 17:23, Bob Goodwin wrote:
>>> There's always more than one way to do it.
>> +
>> Yes, and you have probably provided what I was looking for, I'll try
>> exporting it as you suggest, probably tomorrow and report back. 
> +
> 
> I've got this working except
> 
> # rsync -avr /home/exports/ /mnt/test/backups/
> produces copies of directories devoid of files.
> 
> It looks like I have to do:
> 
> # rsync -avr /home/exports/*  /mnt/test/backups/
> 
> The -r is supposed to get everything recursively but but it did not get
> the files without the "*" ...

The "-r" is redundant, as "-a" is equivalent to "-rlptgoD"

> With your help I had enough confidence to experiment with the NFS
> exports and the backup disk appears to be working as I wanted. /dev/sdb1
> appears to have a complete copy of the data stored on /dev/sdb1 for a
> backup. And I can access it from an Fedora 27 workstation.
> 
> I am still wondering why rsync did not copy everything recursively
> without the asterisk?

Without the "*", rsync is going to be governed by its pattern rules as
shown in rsync's man page section "INCLUDE/EXCLUDE PATTERN RULES". Even
though it may get confusing, pay extra attention to the notes about the
"-r" flag in that section.

The main idea is that you anchored the source to /home/exports, and as
rsync walks down the tree, the subdirectories don't start at
/home/exports (they're children of it) and the files in them are
excluded. It'll create the directories on the target since the directory
names themselves are in /home/exports, but not their content.

When you put in the "*", the shell expanded the list of directories in
/home/exports and passed all of them to rsync. So if you had:

        /home/exports/a
        /home/exports/b

The command the shell actually invoked was

        rsync -avr /home/exports/a /home/exports/b /mnt/test/backups

(note that the last element on the command line is the destination to
rsync...everything else is a source).

The cheap and dirty fix is:

        rsync -av /home/exports --include="exports/***"  /mnt/test/backups

or

        cd /home/exports
        rsync -av /mnt/test/backups

The first one utilizes rsync's include pattern matching rules. The
argument to "--include=" is in quotes so the shell doesn't expand the
"*"s in it.

Also note that the trailing "/" on the destination as you had it is
unnecessary but shouldn't hurt anything.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ri...@alldigital.com -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-           Blech!  ACKth!  Ooop!  -- Bill the Cat (Outland)         -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/POVGY4UGEK7WNEBCJZMNJRRCSKSPCOSE/

Reply via email to