Bash: rsync push_dir “<filename>” 失败:不是目录
Bash: rsync push_dir "<filename>" failed: Not a directory
我如何找到我想要 rsync 的文件:
$files=$(find /tmp -mtime -4 -name '*.abc' -type f 2>/dev/null)
$echo $files
$/tmp/file.abc /tmp/newfile.abc
Rsync 命令:
rsync -v -a --progress --stats --rsh="ssh -o StrictHostKeyChecking=no" --files-from=`echo $files` user@target_host:/tmp/
我看到的错误:
building file list ...
push_dir "/tmp/newfile.abc" failed: Not a directory
rsync error: errors selecting input/output files, dirs (code 3) at flist.c(1055)
Rsync 版本:
$rsync --version
rsync version 2.6.2 protocol version 28
Copyright (C) 1996-2004 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
no IPv6, 32-bit system inums, 64-bit internal inums
如何完成 rsync?
"rsync --files-from=-" 如果指定了 - 则接受管道,因此:
find /tmp -mtime -4 -name '*.abc' -type f 2>/dev/null | rsync -v -a --progress --stats --rsh="ssh -o StrictHostKeyChecking=no" --files-from=- user@target_host:/tmp/
我如何找到我想要 rsync 的文件:
$files=$(find /tmp -mtime -4 -name '*.abc' -type f 2>/dev/null)
$echo $files
$/tmp/file.abc /tmp/newfile.abc
Rsync 命令:
rsync -v -a --progress --stats --rsh="ssh -o StrictHostKeyChecking=no" --files-from=`echo $files` user@target_host:/tmp/
我看到的错误:
building file list ...
push_dir "/tmp/newfile.abc" failed: Not a directory
rsync error: errors selecting input/output files, dirs (code 3) at flist.c(1055)
Rsync 版本:
$rsync --version
rsync version 2.6.2 protocol version 28
Copyright (C) 1996-2004 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
no IPv6, 32-bit system inums, 64-bit internal inums
如何完成 rsync?
"rsync --files-from=-" 如果指定了 - 则接受管道,因此:
find /tmp -mtime -4 -name '*.abc' -type f 2>/dev/null | rsync -v -a --progress --stats --rsh="ssh -o StrictHostKeyChecking=no" --files-from=- user@target_host:/tmp/