rsync remote find prefixes home directory?
Solution 1:
rsync is looking at the wrong place, because those paths are relative (from the rsync man page, emphasis mine):
--files-from=FILE
[..]
The filenames that are read from the FILE are all relative to the source dir
Either send absolute paths to the files-from option, but do not additionally define a source directory other than the root (/). This should work - I replaced one character after the host name:
rsync -avz --dry-run --remove-source-files --from0 --files-from=<(ssh spot@host "find /mnt/volume_2/partners/test/uploads/ -amin +10 -type f,d -print0") spot@host:/ .
Or - and especially useful when you actually want to deal with relative paths in the destination - tell find to emit relative paths and actually use them:
ssh spot@host "cd /mnt/volume_2/partners/test/uploads/; find -amin +10 -type f,d -print0" | rsync -avz --dry-run --remove-source-files --from0 --files-from=- spot@host:/mnt/volume_sfo2_01/partners/test/uploads/ .
Note I switched the <()
redirection to a normal |
pipe for better interoperability and less surprises while escaping the command for inclusion in scripts. I also added --from0
on top of your comment because the input is now null-delimited so it makes sense to tell rsync it is so.