[PLUG] Copying to new host, excluding a directory tree

David Bridges dbridges at austin.rr.com
Wed Jul 31 20:15:20 UTC 2019


> Well, I'm the only human element involved and I have no problems.
> When
> synchronizing an entire directory there's never been an issue. What I
> want
> to learn is how to exclude a specific subdirectory on the source
> host.

In an earlier reply I mentioned using a file to exclude things that is
referenced on the rsync command line.  I know that things can be
excluded as an argument on the command line but I've been tripped up
doing it like that in the past.  I would suggest trying the following 
using your correct information of course.

Create a file on the source node /home/rshepard/excludes.txt that
includes the directory you want to exclude (in this case data no /
needed), and possibly excludes.txt

The following should do what you want as it works prefectly for me with
my specific directories and excludes.

rsync -arvP -e ssh --exclude-from='/home/rshepard/excludes.txt'
/home/rshepard/ rshepard at salmo:/home/rshepard/ 

I have files with commands resembling the one above on several
computers which have worked for me for years.

Hope this helps

--
David





More information about the PLUG mailing list