[PLUG] Copying to new host, excluding a directory tree
Rich Shepard
rshepard at appl-ecosys.com
Wed Jul 17 23:30:35 UTC 2019
On Wed, 17 Jul 2019, Reid wrote:
> The `--exclude` option might do what you need.
Thanks, Reid.
> However, this will also exclude any file names within the ~ directory
> structure that contain the string "data". You could use the find command
> instead to get all the subdirectories of ~ besides ~/data. I believe this
> command will work:
>
> # rsync -r $(find ~ -maxdepth 1 ! -name "data") SRC DEST
Hmm-m. Didn't consider this.
> Ben's exclude pattern doesn't work for me; it still pulls the data dir.
> The `--exclude` option pattern-matches against the file name (and a
> directory name is a file name). It doesn't seem to pattern-match against
> the path.
Ah, yes; rsync compares files and not just directories. I'll try your
command (adding the avz options to the recursive one).
There's sufficient space on the target disk to hold the 96G of the data/
subdirectory, but it will still be a while until I'm ready to replace the
source desktop with the target desktop as my main server/workstation so I'll
be syncing on a regular basis.
Much appreciated,
Rich
More information about the PLUG
mailing list