リモートコンピュータのファイルをリモートコンピュータのフォルダにコピーする

リモートコンピュータのファイルをリモートコンピュータのフォルダにコピーする

リモートフォルダから別のリモートフォルダにファイルをコピーすると、「ファイルやディレクトリがありません」というエラーが発生するのはなぜですか?

 ssh -n -o  ConnectTimeout=50 -o StrictHostKeyChecking=no -xaq  $IP "cp -rp /opt/dir  /tmp"


 cp: cannot stat ‘/opt/dir/edits_inprogress_0000000001294909743’: No such file or directory

…それとももっと良い方法がありますか?

私たちも努力する

 find  /opt/dir  -print0 | rsync -0a --files-from=- --ignore-missing-args /opt/dir /tmp/
rsync: --ignore-missing-args: unknown option
rsync error: syntax or usage error (code 1) at main.c(1435) [client=3.0.9]



rsync --version
rsync  version 3.0.9  protocol version 30
Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

ベストアンサー1

これを実現するには、rsyncコマンドを使用してみてください。

localhost 同期の場合は、次のコマンドを使用できます。

rsync -avzh /home/praveen/10 /var/tmp/

リモートシステムとの同期用

rsync -avzh remotemachineip:/remotemachineath localserverdestinationfolder

おすすめ記事